Skip to content

Commit 4df5443

Browse files
committed
Merged dev branch into master
2 parents eeac111 + 04441df commit 4df5443

File tree

152 files changed

+4232
-9469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+4232
-9469
lines changed

.travis.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# * https://github.com/supermarin/xcpretty#usage
44

55
language: objective-c
6-
osx_image: xcode7.3
6+
osx_image: xcode8
77
# cache: cocoapods
88
# podfile: Example/Podfile
99
env:
@@ -19,6 +19,10 @@ env:
1919
- MACOS_SDK=macosx10.11
2020
- TVOS_SDK=appletvsimulator9.2
2121
- WATCHOS_SDK=watchsimulator2.2
22+
- IOS_SDK=iphonesimulator10.0
23+
- OSX_SDK=macosx10.11
24+
- TVOS_SDK=appletvsimulator10.0
25+
- WATCHOS_SDK=watchsimulator3.0
2226
- EXAMPLE_SCHEME="iOS Example"
2327
matrix:
2428
- DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES"
@@ -36,6 +40,10 @@ env:
3640
- DESTINATION="OS=2.0,name=Apple Watch - 38mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
3741
- DESTINATION="OS=2.1,name=Apple Watch - 38mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
3842
- DESTINATION="OS=2.2,name=Apple Watch - 38mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
43+
- DESTINATION="OS=10.0,name=iPhone 6s Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO"
44+
- DESTINATION="arch=x86_64" SCHEME="$OSX_FRAMEWORK_SCHEME" SDK="$OSX_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
45+
- DESTINATION="OS=10.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO"
46+
- DESTINATION="OS=3.0,name=Apple Watch - 38mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO"
3947
before_install:
4048
# - gem install cocoapods -v '0.39.0' # Since Travis is not always on latest version
4149
# - pod install --project-directory=Example

CHANGELOG.md

+30
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,36 @@
22

33
ForecastIO adheres to [Semantic Versioning](http://semver.org/).
44

5+
## 3.0.0
6+
7+
Released on October 6, 2016.
8+
9+
### Added
10+
- `Result<V>` enum type to encapsulate responses
11+
- `RequestMetadata` to represent data about the consumption of the Dark Sky API
12+
- `ForecastIOError` to represent errors in interacting with the Dark Sky API
13+
- Explicit gzip encoding to all Dark Sky API requests
14+
15+
### Updated
16+
- Lowercased all enum cases
17+
- Moved `ForecastField` enum under `Forecast` as `Field`
18+
- Expanded `precip` on properties to `precipitation`
19+
- `DataBlock.data` is no longer optional
20+
- `Alert.description` is no longer optional
21+
- `Flag.sources` and `Flag.units` are no longer optional
22+
- `Flag.units` is now a `Units` enum type
23+
- API endpoint is now `api.darksky.net` instead of `api.forecast.io`
24+
- `getForecast` methods renamed `completion` to `completionHandler`
25+
- `getForecast` methods' `completionHandler`s now return `Result<Forecast>`
26+
- Documentation formatting
27+
- `APIClient` is now `DarkSkyClient`
28+
29+
### Removed
30+
- `Units.uk2` is gone and its value is now represented by `Units.uk`
31+
- `CustomStringConvertible` protocol conformance from all enums
32+
- `Forecast.offset`
33+
- Constants file and `ForecastIOErrorCode` and `ForecastIOErrorDomain`
34+
535
## 2.1.1
636

737
Released on July 25, 2016.

Example/iOS Example.xcodeproj/project.pbxproj

+12-4
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
4AFFE77D1CD9617400464121 /* ForecastIO.framework */,
125125
4AFFE77F1CD9617400464121 /* ForecastIO tvOS Tests.xctest */,
126126
4AFFE7811CD9617400464121 /* ForecastIO.framework */,
127-
4AFFE7831CD9617400464121 /* ForecastIO OS X Tests.xctest */,
127+
4AFFE7831CD9617400464121 /* ForecastIO macOS Tests.xctest */,
128128
4AFFE7851CD9617400464121 /* ForecastIO.framework */,
129129
);
130130
name = Products;
@@ -191,11 +191,12 @@
191191
isa = PBXProject;
192192
attributes = {
193193
LastSwiftUpdateCheck = 0720;
194-
LastUpgradeCheck = 0720;
194+
LastUpgradeCheck = 0800;
195195
ORGANIZATIONNAME = CocoaPods;
196196
TargetAttributes = {
197197
D4B85D7D1C53324600BD2FCD = {
198198
CreatedOnToolsVersion = 7.2;
199+
LastSwiftMigration = 0800;
199200
};
200201
};
201202
};
@@ -259,10 +260,10 @@
259260
remoteRef = 4AFFE7801CD9617400464121 /* PBXContainerItemProxy */;
260261
sourceTree = BUILT_PRODUCTS_DIR;
261262
};
262-
4AFFE7831CD9617400464121 /* ForecastIO OS X Tests.xctest */ = {
263+
4AFFE7831CD9617400464121 /* ForecastIO macOS Tests.xctest */ = {
263264
isa = PBXReferenceProxy;
264265
fileType = wrapper.cfbundle;
265-
path = "ForecastIO OS X Tests.xctest";
266+
path = "ForecastIO macOS Tests.xctest";
266267
remoteRef = 4AFFE7821CD9617400464121 /* PBXContainerItemProxy */;
267268
sourceTree = BUILT_PRODUCTS_DIR;
268269
};
@@ -356,8 +357,10 @@
356357
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
357358
CLANG_WARN_EMPTY_BODY = YES;
358359
CLANG_WARN_ENUM_CONVERSION = YES;
360+
CLANG_WARN_INFINITE_RECURSION = YES;
359361
CLANG_WARN_INT_CONVERSION = YES;
360362
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
363+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
361364
CLANG_WARN_UNREACHABLE_CODE = YES;
362365
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
363366
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -401,8 +404,10 @@
401404
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
402405
CLANG_WARN_EMPTY_BODY = YES;
403406
CLANG_WARN_ENUM_CONVERSION = YES;
407+
CLANG_WARN_INFINITE_RECURSION = YES;
404408
CLANG_WARN_INT_CONVERSION = YES;
405409
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
410+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
406411
CLANG_WARN_UNREACHABLE_CODE = YES;
407412
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
408413
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -435,6 +440,7 @@
435440
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
436441
PRODUCT_BUNDLE_IDENTIFIER = "io.Satyam.iOS-Example";
437442
PRODUCT_NAME = "$(TARGET_NAME)";
443+
SWIFT_VERSION = 3.0;
438444
TARGETED_DEVICE_FAMILY = "1,2";
439445
};
440446
name = Debug;
@@ -448,6 +454,8 @@
448454
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
449455
PRODUCT_BUNDLE_IDENTIFIER = "io.Satyam.iOS-Example";
450456
PRODUCT_NAME = "$(TARGET_NAME)";
457+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
458+
SWIFT_VERSION = 3.0;
451459
TARGETED_DEVICE_FAMILY = "1,2";
452460
};
453461
name = Release;

Example/iOS Example/AppDelegate.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
var window: UIWindow?
1515

1616

17-
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
17+
@nonobjc func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
1818
// Override point for customization after application launch.
1919
return true
2020
}
2121

22-
func applicationWillResignActive(application: UIApplication) {
22+
func applicationWillResignActive(_ application: UIApplication) {
2323
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
2424
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
2525
}
2626

27-
func applicationDidEnterBackground(application: UIApplication) {
27+
func applicationDidEnterBackground(_ application: UIApplication) {
2828
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
2929
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
3030
}
3131

32-
func applicationWillEnterForeground(application: UIApplication) {
32+
func applicationWillEnterForeground(_ application: UIApplication) {
3333
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
3434
}
3535

36-
func applicationDidBecomeActive(application: UIApplication) {
36+
func applicationDidBecomeActive(_ application: UIApplication) {
3737
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
3838
}
3939

40-
func applicationWillTerminate(application: UIApplication) {
40+
func applicationWillTerminate(_ application: UIApplication) {
4141
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
4242
}
4343

Example/iOS Example/ViewController.swift

+11-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ class ViewController: UIViewController {
1515
super.viewDidLoad()
1616
// Do any additional setup after loading the view, typically from a nib.
1717

18-
let client = APIClient(apiKey: "FAKE-API-KEY")
19-
client.units = .Auto
20-
client.language = .English
21-
client.getForecast(latitude: 30, longitude: 30, excludeForecastFields: [.Alerts, .Currently, .Daily, .Flags, .Minutely]) { (forecast, error) in
22-
print(forecast?.hourly?.data)
18+
let client = DarkSkyClient(apiKey: "FAKE-API-KEY")
19+
client.units = .auto
20+
client.language = .english
21+
client.getForecast(latitude: 30, longitude: 30, excludeFields: [.alerts, .currently, .daily, .flags, .minutely]) { (result) in
22+
switch result {
23+
case .success(let forecast, let requestMetadata):
24+
print(forecast.hourly?.data)
25+
print(requestMetadata)
26+
case .failure(let error):
27+
print(error)
28+
}
2329
}
2430
}
2531

ForecastIO.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
Pod::Spec.new do |s|
1111
s.name = "ForecastIO"
12-
s.version = "2.1.1"
12+
s.version = "3.0.0"
1313
s.summary = "ForecastIO is a Swift library for interfacing with the Dark Sky forecast API."
1414
s.homepage = "https://github.com/sxg/ForecastIO"
1515
s.license = 'MIT'

0 commit comments

Comments
 (0)