diff --git a/Chapter2/Chapter2-3/MyFistApp/MyFistApp.xcodeproj/project.pbxproj b/Chapter2/Chapter2-3/MyFistApp/MyFistApp.xcodeproj/project.pbxproj index 8627de9..c1fbc4f 100644 --- a/Chapter2/Chapter2-3/MyFistApp/MyFistApp.xcodeproj/project.pbxproj +++ b/Chapter2/Chapter2-3/MyFistApp/MyFistApp.xcodeproj/project.pbxproj @@ -191,18 +191,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9ECC46CC1C12E0E90039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; }; 9ECC46E01C12E0EA0039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9ECC46CC1C12E0E90039DE4D; }; 9ECC46EB1C12E0EA0039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9ECC46CC1C12E0E90039DE4D; }; }; @@ -329,8 +332,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -373,8 +378,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -393,6 +400,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -405,6 +413,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistApp; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -416,6 +425,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistApp; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -427,6 +437,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistAppTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MyFistApp.app/MyFistApp"; }; name = Debug; @@ -439,6 +450,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistAppTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MyFistApp.app/MyFistApp"; }; name = Release; @@ -450,6 +462,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistAppUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = MyFistApp; USES_XCTRUNNER = YES; }; @@ -462,6 +475,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistAppUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = MyFistApp; USES_XCTRUNNER = YES; }; diff --git a/Chapter2/Chapter2-3/MyFistApp/MyFistApp/AppDelegate.swift b/Chapter2/Chapter2-3/MyFistApp/MyFistApp/AppDelegate.swift index 7b697e7..b237b02 100644 --- a/Chapter2/Chapter2-3/MyFistApp/MyFistApp/AppDelegate.swift +++ b/Chapter2/Chapter2-3/MyFistApp/MyFistApp/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter2/Chapter2-3/MyFistApp/MyFistApp/Base.lproj/LaunchScreen.storyboard b/Chapter2/Chapter2-3/MyFistApp/MyFistApp/Base.lproj/LaunchScreen.storyboard index 977ea30..1d03c2d 100644 --- a/Chapter2/Chapter2-3/MyFistApp/MyFistApp/Base.lproj/LaunchScreen.storyboard +++ b/Chapter2/Chapter2-3/MyFistApp/MyFistApp/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter2/Chapter2-3/MyFistApp/MyFistApp/Base.lproj/Main.storyboard b/Chapter2/Chapter2-3/MyFistApp/MyFistApp/Base.lproj/Main.storyboard index 4deccd0..471c84b 100644 --- a/Chapter2/Chapter2-3/MyFistApp/MyFistApp/Base.lproj/Main.storyboard +++ b/Chapter2/Chapter2-3/MyFistApp/MyFistApp/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -19,21 +23,23 @@ + - + - diff --git a/Chapter2/Chapter2-3/MyFistApp/MyFistAppTests/MyFistAppTests.swift b/Chapter2/Chapter2-3/MyFistApp/MyFistAppTests/MyFistAppTests.swift index bcd51ec..66c309f 100644 --- a/Chapter2/Chapter2-3/MyFistApp/MyFistAppTests/MyFistAppTests.swift +++ b/Chapter2/Chapter2-3/MyFistApp/MyFistAppTests/MyFistAppTests.swift @@ -28,7 +28,7 @@ class MyFistAppTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter2/Chapter2-4/MyFistApp/MyFistApp.xcodeproj/project.pbxproj b/Chapter2/Chapter2-4/MyFistApp/MyFistApp.xcodeproj/project.pbxproj index 8627de9..c1fbc4f 100644 --- a/Chapter2/Chapter2-4/MyFistApp/MyFistApp.xcodeproj/project.pbxproj +++ b/Chapter2/Chapter2-4/MyFistApp/MyFistApp.xcodeproj/project.pbxproj @@ -191,18 +191,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9ECC46CC1C12E0E90039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; }; 9ECC46E01C12E0EA0039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9ECC46CC1C12E0E90039DE4D; }; 9ECC46EB1C12E0EA0039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9ECC46CC1C12E0E90039DE4D; }; }; @@ -329,8 +332,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -373,8 +378,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -393,6 +400,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -405,6 +413,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistApp; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -416,6 +425,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistApp; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -427,6 +437,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistAppTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MyFistApp.app/MyFistApp"; }; name = Debug; @@ -439,6 +450,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistAppTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MyFistApp.app/MyFistApp"; }; name = Release; @@ -450,6 +462,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistAppUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = MyFistApp; USES_XCTRUNNER = YES; }; @@ -462,6 +475,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.MyFistAppUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = MyFistApp; USES_XCTRUNNER = YES; }; diff --git a/Chapter2/Chapter2-4/MyFistApp/MyFistApp/AppDelegate.swift b/Chapter2/Chapter2-4/MyFistApp/MyFistApp/AppDelegate.swift index 7b697e7..b237b02 100644 --- a/Chapter2/Chapter2-4/MyFistApp/MyFistApp/AppDelegate.swift +++ b/Chapter2/Chapter2-4/MyFistApp/MyFistApp/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter2/Chapter2-4/MyFistApp/MyFistApp/Base.lproj/LaunchScreen.storyboard b/Chapter2/Chapter2-4/MyFistApp/MyFistApp/Base.lproj/LaunchScreen.storyboard index 977ea30..1d03c2d 100644 --- a/Chapter2/Chapter2-4/MyFistApp/MyFistApp/Base.lproj/LaunchScreen.storyboard +++ b/Chapter2/Chapter2-4/MyFistApp/MyFistApp/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter2/Chapter2-4/MyFistApp/MyFistApp/Base.lproj/Main.storyboard b/Chapter2/Chapter2-4/MyFistApp/MyFistApp/Base.lproj/Main.storyboard index 6137d54..aa639e3 100644 --- a/Chapter2/Chapter2-4/MyFistApp/MyFistApp/Base.lproj/Main.storyboard +++ b/Chapter2/Chapter2-4/MyFistApp/MyFistApp/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -19,9 +23,11 @@ + - + - diff --git a/Chapter2/Chapter2-4/MyFistApp/MyFistApp/ViewController.swift b/Chapter2/Chapter2-4/MyFistApp/MyFistApp/ViewController.swift index 961537a..2bae9e2 100644 --- a/Chapter2/Chapter2-4/MyFistApp/MyFistApp/ViewController.swift +++ b/Chapter2/Chapter2-4/MyFistApp/MyFistApp/ViewController.swift @@ -22,7 +22,7 @@ class ViewController: UIViewController { } - @IBAction func tappedButton(sender: AnyObject) { + @IBAction func tappedButton(_ sender: AnyObject) { label.text = "めでたい!!" } } diff --git a/Chapter2/Chapter2-4/MyFistApp/MyFistAppTests/MyFistAppTests.swift b/Chapter2/Chapter2-4/MyFistApp/MyFistAppTests/MyFistAppTests.swift index bcd51ec..66c309f 100644 --- a/Chapter2/Chapter2-4/MyFistApp/MyFistAppTests/MyFistAppTests.swift +++ b/Chapter2/Chapter2-4/MyFistApp/MyFistAppTests/MyFistAppTests.swift @@ -28,7 +28,7 @@ class MyFistAppTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter3/MyPlayground.playground/Contents.swift b/Chapter3/MyPlayground.playground/Contents.swift index 265d7eb..592f77f 100644 --- a/Chapter3/MyPlayground.playground/Contents.swift +++ b/Chapter3/MyPlayground.playground/Contents.swift @@ -24,8 +24,8 @@ x * y x / y x % y -x++ // インクリメント演算子。x = x + 1と同じであり、xに1が加算される -x-- // デクリメント演算子。x = x - 1と同じであり、xに1が減算される +//x++ // Swift3で非推奨に。インクリメント演算子。x = x + 1と同じであり、xに1が加算される +//x-- // Swift3で非推奨に。デクリメント演算子。x = x - 1と同じであり、xに1が減算される x += 5 // 複合代入演算子。x = x + 5と同じであり、xに5が加算される x -= 5 // 複合代入演算子。x = x - 5と同じであり、xに5が減算される @@ -115,15 +115,18 @@ var score2 = 0 var str7 = "あなたのスコアは\(score)点です" var str8 = "HELLO" -str8.lowercaseString +//str8.lowercaseString +str8.lowercased() var str9 = "hello" -str9.uppercaseString +//str9.uppercaseString +str9.uppercased() str9.characters.count var str10 = "Hello, Swift" -str10.componentsSeparatedByString(",") +//str10.componentsSeparatedByString(",") +str10.components(separatedBy: ",") // Chapter3-5 @@ -142,7 +145,8 @@ daysArray2.count daysArray2[2] = "水曜" daysArray2 -daysArray2.removeAtIndex(2) +//daysArray2.removeAtIndex(2) +daysArray2.remove(at: 2) daysArray2 daysArray2.removeLast() @@ -155,7 +159,8 @@ var daysArray3 = ["月", "火", "木", "金", "土"] daysArray3.append("日") daysArray3 -daysArray3.insert("水", atIndex: 2) +//daysArray3.insert("水", atIndex: 2) +daysArray3.insert("水", at: 2) // 辞書 @@ -182,7 +187,8 @@ scoreDic3 scoreDic3["社会"] = 50 scoreDic3 -scoreDic3.removeValueForKey("社会") +//scoreDic3.removeValueForKey("社会") +scoreDic3.removeValue(forKey: "社会") scoreDic3 scoreDic3.removeAll() diff --git a/Chapter3/MyPlayground.playground/timeline.xctimeline b/Chapter3/MyPlayground.playground/timeline.xctimeline deleted file mode 100644 index bf468af..0000000 --- a/Chapter3/MyPlayground.playground/timeline.xctimeline +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj b/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj index f33b8e6..92607b4 100644 --- a/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj +++ b/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj @@ -256,18 +256,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9EDF4BDC1C0D978000F90BD1 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; }; 9EDF4BF01C0D978000F90BD1 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9EDF4BDC1C0D978000F90BD1; }; 9EDF4BFB1C0D978000F90BD1 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9EDF4BDC1C0D978000F90BD1; }; }; @@ -413,8 +416,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -457,8 +462,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -477,6 +484,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -489,6 +497,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiro; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -500,6 +509,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiro; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -511,6 +521,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ShingoHaNaniiro.app/ShingoHaNaniiro"; }; name = Debug; @@ -523,6 +534,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ShingoHaNaniiro.app/ShingoHaNaniiro"; }; name = Release; @@ -534,6 +546,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = ShingoHaNaniiro; USES_XCTRUNNER = YES; }; @@ -546,6 +559,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = ShingoHaNaniiro; USES_XCTRUNNER = YES; }; @@ -570,6 +584,7 @@ 9EDF4C071C0D978000F90BD1 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9EDF4C081C0D978000F90BD1 /* Build configuration list for PBXNativeTarget "ShingoHaNaniiroTests" */ = { isa = XCConfigurationList; @@ -578,6 +593,7 @@ 9EDF4C0A1C0D978000F90BD1 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9EDF4C0B1C0D978000F90BD1 /* Build configuration list for PBXNativeTarget "ShingoHaNaniiroUITests" */ = { isa = XCConfigurationList; @@ -586,6 +602,7 @@ 9EDF4C0D1C0D978000F90BD1 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift b/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift index fabd26b..a7723a0 100644 --- a/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift +++ b/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard b/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard index 977ea30..1d03c2d 100644 --- a/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard +++ b/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard b/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard index 991327b..6906127 100644 --- a/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard +++ b/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -20,12 +24,12 @@ - - - + @@ -95,8 +99,6 @@ - - @@ -104,13 +106,13 @@ - - - - - - - + + + + + + + diff --git a/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift b/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift index 8e2d73e..19539e3 100644 --- a/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift +++ b/Chapter4/Chapter4-2/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift @@ -28,7 +28,7 @@ class ShingoHaNaniiroTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj index f33b8e6..92607b4 100644 --- a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj +++ b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj @@ -256,18 +256,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9EDF4BDC1C0D978000F90BD1 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; }; 9EDF4BF01C0D978000F90BD1 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9EDF4BDC1C0D978000F90BD1; }; 9EDF4BFB1C0D978000F90BD1 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9EDF4BDC1C0D978000F90BD1; }; }; @@ -413,8 +416,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -457,8 +462,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -477,6 +484,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -489,6 +497,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiro; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -500,6 +509,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiro; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -511,6 +521,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ShingoHaNaniiro.app/ShingoHaNaniiro"; }; name = Debug; @@ -523,6 +534,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ShingoHaNaniiro.app/ShingoHaNaniiro"; }; name = Release; @@ -534,6 +546,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = ShingoHaNaniiro; USES_XCTRUNNER = YES; }; @@ -546,6 +559,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = ShingoHaNaniiro; USES_XCTRUNNER = YES; }; @@ -570,6 +584,7 @@ 9EDF4C071C0D978000F90BD1 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9EDF4C081C0D978000F90BD1 /* Build configuration list for PBXNativeTarget "ShingoHaNaniiroTests" */ = { isa = XCConfigurationList; @@ -578,6 +593,7 @@ 9EDF4C0A1C0D978000F90BD1 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9EDF4C0B1C0D978000F90BD1 /* Build configuration list for PBXNativeTarget "ShingoHaNaniiroUITests" */ = { isa = XCConfigurationList; @@ -586,6 +602,7 @@ 9EDF4C0D1C0D978000F90BD1 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift index fabd26b..a7723a0 100644 --- a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift +++ b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Assets.xcassets/AppIcon.appiconset/Contents.json b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..b8236c6 100644 --- a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", diff --git a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard index 977ea30..1d03c2d 100644 --- a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard +++ b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard index 1a9d396..62f4788 100644 --- a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard +++ b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -24,13 +28,13 @@ - + @@ -104,8 +108,6 @@ - - @@ -116,13 +118,13 @@ - - - - - - - + + + + + + + diff --git a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/ViewController.swift b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/ViewController.swift index 900d036..fa4a48b 100644 --- a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/ViewController.swift +++ b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiro/ViewController.swift @@ -20,17 +20,17 @@ class ViewController: UIViewController { // Dispose of any resources that can be recreated. } - @IBAction func blueBtnPushed(sender: AnyObject) { + @IBAction func blueBtnPushed(_ sender: AnyObject) { resultLabel.text = "しんごうはあおいろ!" - resultLabel.textColor = UIColor.blueColor() + resultLabel.textColor = UIColor.blue } - @IBAction func yellowBtnPushed(sender: AnyObject) { + @IBAction func yellowBtnPushed(_ sender: AnyObject) { resultLabel.text = "しんごうはきいろ!" - resultLabel.textColor = UIColor.yellowColor() + resultLabel.textColor = UIColor.yellow } - @IBAction func redBtnPushed(sender: AnyObject) { + @IBAction func redBtnPushed(_ sender: AnyObject) { resultLabel.text = "しんごうはあかいろ!" - resultLabel.textColor = UIColor.redColor() + resultLabel.textColor = UIColor.red } } diff --git a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift index 8e2d73e..19539e3 100644 --- a/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift +++ b/Chapter4/Chapter4-3/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift @@ -28,7 +28,7 @@ class ShingoHaNaniiroTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj index f33b8e6..92607b4 100644 --- a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj +++ b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro.xcodeproj/project.pbxproj @@ -256,18 +256,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9EDF4BDC1C0D978000F90BD1 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; }; 9EDF4BF01C0D978000F90BD1 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9EDF4BDC1C0D978000F90BD1; }; 9EDF4BFB1C0D978000F90BD1 = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9EDF4BDC1C0D978000F90BD1; }; }; @@ -413,8 +416,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -457,8 +462,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -477,6 +484,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -489,6 +497,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiro; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -500,6 +509,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiro; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -511,6 +521,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ShingoHaNaniiro.app/ShingoHaNaniiro"; }; name = Debug; @@ -523,6 +534,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ShingoHaNaniiro.app/ShingoHaNaniiro"; }; name = Release; @@ -534,6 +546,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = ShingoHaNaniiro; USES_XCTRUNNER = YES; }; @@ -546,6 +559,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ShingoHaNaniiroUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = ShingoHaNaniiro; USES_XCTRUNNER = YES; }; @@ -570,6 +584,7 @@ 9EDF4C071C0D978000F90BD1 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9EDF4C081C0D978000F90BD1 /* Build configuration list for PBXNativeTarget "ShingoHaNaniiroTests" */ = { isa = XCConfigurationList; @@ -578,6 +593,7 @@ 9EDF4C0A1C0D978000F90BD1 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9EDF4C0B1C0D978000F90BD1 /* Build configuration list for PBXNativeTarget "ShingoHaNaniiroUITests" */ = { isa = XCConfigurationList; @@ -586,6 +602,7 @@ 9EDF4C0D1C0D978000F90BD1 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift index fabd26b..a7723a0 100644 --- a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift +++ b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Assets.xcassets/AppIcon.appiconset/Contents.json b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Assets.xcassets/AppIcon.appiconset/Contents.json index 7e1afb0..bede15b 100644 --- a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", diff --git a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard index 977ea30..1d03c2d 100644 --- a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard +++ b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard index e081abb..4235232 100644 --- a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard +++ b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -23,13 +27,13 @@ - - - - - - - - + + + + + + + diff --git a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/ViewController.swift b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/ViewController.swift index f439d48..c5b2a12 100644 --- a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/ViewController.swift +++ b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiro/ViewController.swift @@ -37,9 +37,9 @@ class ViewController: UIViewController { } - @IBAction func blueBtnPushed(sender: AnyObject) { + @IBAction func blueBtnPushed(_ sender: AnyObject) { // resultLabel.text = "しんごうはあおいろ!" - resultLabel.textColor = UIColor.blueColor() + resultLabel.textColor = UIColor.blue //青信号についての判定処理 if signalImageView.image == blueImage { @@ -50,8 +50,8 @@ class ViewController: UIViewController { randomSignal() } - @IBAction func yellowBtnPushed(sender: AnyObject) { - resultLabel.textColor = UIColor.yellowColor() + @IBAction func yellowBtnPushed(_ sender: AnyObject) { + resultLabel.textColor = UIColor.yellow //黄信号についての判定処理をコーディング if signalImageView.image == yellowImage { @@ -62,8 +62,8 @@ class ViewController: UIViewController { //randomSignalメソッドを実行 randomSignal() } - @IBAction func redBtnPushed(sender: AnyObject) { - resultLabel.textColor = UIColor.redColor() + @IBAction func redBtnPushed(_ sender: AnyObject) { + resultLabel.textColor = UIColor.red //赤信号についての判定処理をコーディング if signalImageView.image == redImage { diff --git a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift index 8e2d73e..19539e3 100644 --- a/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift +++ b/Chapter4/Chapter4-4/ShingoHaNaniiro/ShingoHaNaniiroTests/ShingoHaNaniiroTests.swift @@ -28,7 +28,7 @@ class ShingoHaNaniiroTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter5/5-1_Cowbell/Cowbell.xcodeproj/project.pbxproj b/Chapter5/5-1_Cowbell/Cowbell.xcodeproj/project.pbxproj index f80f389..66b97ee 100644 --- a/Chapter5/5-1_Cowbell/Cowbell.xcodeproj/project.pbxproj +++ b/Chapter5/5-1_Cowbell/Cowbell.xcodeproj/project.pbxproj @@ -100,11 +100,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = KuwamuraHaruyoshi; TargetAttributes = { A4AE95691BE5F360008C6A3C = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0820; }; }; }; @@ -187,8 +188,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -231,8 +234,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -251,6 +256,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -263,6 +269,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onTheHammock.Cowbell; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -274,6 +281,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onTheHammock.Cowbell; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -296,6 +304,7 @@ A4AE957E1BE5F360008C6A3C /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Chapter5/5-1_Cowbell/Cowbell/AppDelegate.swift b/Chapter5/5-1_Cowbell/Cowbell/AppDelegate.swift index c345c9d..c9d53ca 100644 --- a/Chapter5/5-1_Cowbell/Cowbell/AppDelegate.swift +++ b/Chapter5/5-1_Cowbell/Cowbell/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter5/5-1_Cowbell/Cowbell/Assets.xcassets/AppIcon.appiconset/Contents.json b/Chapter5/5-1_Cowbell/Cowbell/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..b8236c6 100644 --- a/Chapter5/5-1_Cowbell/Cowbell/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Chapter5/5-1_Cowbell/Cowbell/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", diff --git a/Chapter5/5-1_Cowbell/Cowbell/Base.lproj/LaunchScreen.storyboard b/Chapter5/5-1_Cowbell/Cowbell/Base.lproj/LaunchScreen.storyboard index 977ea30..9eb210b 100644 --- a/Chapter5/5-1_Cowbell/Cowbell/Base.lproj/LaunchScreen.storyboard +++ b/Chapter5/5-1_Cowbell/Cowbell/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter5/5-1_Cowbell/Cowbell/Base.lproj/Main.storyboard b/Chapter5/5-1_Cowbell/Cowbell/Base.lproj/Main.storyboard index 4aa9846..e38d21d 100644 --- a/Chapter5/5-1_Cowbell/Cowbell/Base.lproj/Main.storyboard +++ b/Chapter5/5-1_Cowbell/Cowbell/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,18 +18,18 @@ - + - - + diff --git a/Chapter5/5-1_Cowbell/Cowbell/ViewController.swift b/Chapter5/5-1_Cowbell/Cowbell/ViewController.swift index f218827..b04e23e 100644 --- a/Chapter5/5-1_Cowbell/Cowbell/ViewController.swift +++ b/Chapter5/5-1_Cowbell/Cowbell/ViewController.swift @@ -15,12 +15,12 @@ class ViewController: UIViewController { //音声を制御するための変数player var player: AVAudioPlayer! - @IBAction func play(sender: AnyObject) { + @IBAction func play(_ sender: AnyObject) { //サウンドファイルを読み込む - let url = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent("cowbell.mp3") + let url = Bundle.main.bundleURL.appendingPathComponent("cowbell.mp3") do { - try player = AVAudioPlayer(contentsOfURL: url) + try player = AVAudioPlayer(contentsOf: url) player.play() } catch { diff --git a/Chapter5/5-2_WinePiano/MyPlayground.playground/Contents.swift b/Chapter5/5-2_WinePiano/MyPlayground.playground/Contents.swift index 19e69f1..ec4de7a 100644 --- a/Chapter5/5-2_WinePiano/MyPlayground.playground/Contents.swift +++ b/Chapter5/5-2_WinePiano/MyPlayground.playground/Contents.swift @@ -11,7 +11,7 @@ func adding(num1: Int, num2: Int) -> Int { } //Int型の変数addResultを宣言 var addResult: Int -addResult = adding(1, num2: 2) +addResult = adding(num1: 1, num2: 2) //引数にラベルを付けた足し算メソッド func adding3(number1 num1: Int, number num2: Int) -> Int{ //変数addnumに引数num1と引数num2を足した値を代入 diff --git a/Chapter5/5-2_WinePiano/MyPlayground.playground/timeline.xctimeline b/Chapter5/5-2_WinePiano/MyPlayground.playground/timeline.xctimeline deleted file mode 100644 index bf468af..0000000 --- a/Chapter5/5-2_WinePiano/MyPlayground.playground/timeline.xctimeline +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/Chapter5/5-2_WinePiano/WinePiano.xcodeproj/project.pbxproj b/Chapter5/5-2_WinePiano/WinePiano.xcodeproj/project.pbxproj index 5590767..1cfd922 100644 --- a/Chapter5/5-2_WinePiano/WinePiano.xcodeproj/project.pbxproj +++ b/Chapter5/5-2_WinePiano/WinePiano.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 1874A5C71E1C285000AC5B3A /* Icon in Resources */ = {isa = PBXBuildFile; fileRef = 1874A5C61E1C285000AC5B3A /* Icon */; }; 9EE8419C1C10151300DBC46E /* SEManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EE8419B1C10151300DBC46E /* SEManager.swift */; }; A4AE95D01BE620FE008C6A3C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4AE95CF1BE620FE008C6A3C /* AppDelegate.swift */; }; A4AE95D21BE620FE008C6A3C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4AE95D11BE620FE008C6A3C /* ViewController.swift */; }; @@ -15,7 +16,6 @@ A4AE95DA1BE620FE008C6A3C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95D81BE620FE008C6A3C /* LaunchScreen.storyboard */; }; A4AE95EF1BE62143008C6A3C /* background.png in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95E21BE62143008C6A3C /* background.png */; }; A4AE95F01BE62143008C6A3C /* background@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95E31BE62143008C6A3C /* background@2x.png */; }; - A4AE95F11BE62143008C6A3C /* Icon in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95E41BE62143008C6A3C /* Icon */; }; A4AE95F21BE62143008C6A3C /* wine.png in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95E51BE62143008C6A3C /* wine.png */; }; A4AE95F31BE62143008C6A3C /* wine@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95E61BE62143008C6A3C /* wine@2x.png */; }; A4AE95F41BE62143008C6A3C /* 1.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95E81BE62143008C6A3C /* 1.mp3 */; }; @@ -24,10 +24,10 @@ A4AE95F71BE62143008C6A3C /* 4.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95EB1BE62143008C6A3C /* 4.mp3 */; }; A4AE95F81BE62143008C6A3C /* 5.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95EC1BE62143008C6A3C /* 5.mp3 */; }; A4AE95F91BE62143008C6A3C /* BGM.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95ED1BE62143008C6A3C /* BGM.mp3 */; }; - A4AE95FA1BE62143008C6A3C /* Icon in Resources */ = {isa = PBXBuildFile; fileRef = A4AE95EE1BE62143008C6A3C /* Icon */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 1874A5C61E1C285000AC5B3A /* Icon */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Icon "; sourceTree = ""; }; 9EE8419B1C10151300DBC46E /* SEManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SEManager.swift; sourceTree = ""; }; A4AE95CC1BE620FE008C6A3C /* WinePiano.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WinePiano.app; sourceTree = BUILT_PRODUCTS_DIR; }; A4AE95CF1BE620FE008C6A3C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -38,7 +38,6 @@ A4AE95DB1BE620FE008C6A3C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A4AE95E21BE62143008C6A3C /* background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = background.png; sourceTree = ""; }; A4AE95E31BE62143008C6A3C /* background@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "background@2x.png"; sourceTree = ""; }; - A4AE95E41BE62143008C6A3C /* Icon */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Icon "; sourceTree = ""; }; A4AE95E51BE62143008C6A3C /* wine.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wine.png; sourceTree = ""; }; A4AE95E61BE62143008C6A3C /* wine@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "wine@2x.png"; sourceTree = ""; }; A4AE95E81BE62143008C6A3C /* 1.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 1.mp3; sourceTree = ""; }; @@ -47,7 +46,6 @@ A4AE95EB1BE62143008C6A3C /* 4.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 4.mp3; sourceTree = ""; }; A4AE95EC1BE62143008C6A3C /* 5.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = 5.mp3; sourceTree = ""; }; A4AE95ED1BE62143008C6A3C /* BGM.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = BGM.mp3; sourceTree = ""; }; - A4AE95EE1BE62143008C6A3C /* Icon */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Icon "; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -96,9 +94,9 @@ A4AE95E11BE62143008C6A3C /* Image */ = { isa = PBXGroup; children = ( + 1874A5C61E1C285000AC5B3A /* Icon */, A4AE95E21BE62143008C6A3C /* background.png */, A4AE95E31BE62143008C6A3C /* background@2x.png */, - A4AE95E41BE62143008C6A3C /* Icon */, A4AE95E51BE62143008C6A3C /* wine.png */, A4AE95E61BE62143008C6A3C /* wine@2x.png */, ); @@ -114,7 +112,6 @@ A4AE95EB1BE62143008C6A3C /* 4.mp3 */, A4AE95EC1BE62143008C6A3C /* 5.mp3 */, A4AE95ED1BE62143008C6A3C /* BGM.mp3 */, - A4AE95EE1BE62143008C6A3C /* Icon */, ); path = Sound; sourceTree = ""; @@ -146,11 +143,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = KuwamuraHaruyoshi; TargetAttributes = { A4AE95CB1BE620FE008C6A3C = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0820; }; }; }; @@ -178,15 +176,14 @@ buildActionMask = 2147483647; files = ( A4AE95F61BE62143008C6A3C /* 3.mp3 in Resources */, + 1874A5C71E1C285000AC5B3A /* Icon in Resources */, A4AE95F81BE62143008C6A3C /* 5.mp3 in Resources */, A4AE95F41BE62143008C6A3C /* 1.mp3 in Resources */, A4AE95DA1BE620FE008C6A3C /* LaunchScreen.storyboard in Resources */, A4AE95F71BE62143008C6A3C /* 4.mp3 in Resources */, A4AE95EF1BE62143008C6A3C /* background.png in Resources */, - A4AE95FA1BE62143008C6A3C /* Icon in Resources */, A4AE95D71BE620FE008C6A3C /* Assets.xcassets in Resources */, A4AE95F31BE62143008C6A3C /* wine@2x.png in Resources */, - A4AE95F11BE62143008C6A3C /* Icon in Resources */, A4AE95F01BE62143008C6A3C /* background@2x.png in Resources */, A4AE95F51BE62143008C6A3C /* 2.mp3 in Resources */, A4AE95F91BE62143008C6A3C /* BGM.mp3 in Resources */, @@ -243,8 +240,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -287,8 +286,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -307,6 +308,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -319,6 +321,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onTheHammock.WinePiano; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -330,6 +333,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onTheHammock.WinePiano; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/Chapter5/5-2_WinePiano/WinePiano/AppDelegate.swift b/Chapter5/5-2_WinePiano/WinePiano/AppDelegate.swift index 9c544f4..07903f4 100644 --- a/Chapter5/5-2_WinePiano/WinePiano/AppDelegate.swift +++ b/Chapter5/5-2_WinePiano/WinePiano/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter5/5-2_WinePiano/WinePiano/Assets.xcassets/AppIcon.appiconset/Contents.json b/Chapter5/5-2_WinePiano/WinePiano/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..b8236c6 100644 --- a/Chapter5/5-2_WinePiano/WinePiano/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Chapter5/5-2_WinePiano/WinePiano/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", diff --git a/Chapter5/5-2_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard b/Chapter5/5-2_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard index 977ea30..9eb210b 100644 --- a/Chapter5/5-2_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard +++ b/Chapter5/5-2_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter5/5-2_WinePiano/WinePiano/Base.lproj/Main.storyboard b/Chapter5/5-2_WinePiano/WinePiano/Base.lproj/Main.storyboard index 94b8001..6920bed 100644 --- a/Chapter5/5-2_WinePiano/WinePiano/Base.lproj/Main.storyboard +++ b/Chapter5/5-2_WinePiano/WinePiano/Base.lproj/Main.storyboard @@ -1,9 +1,13 @@ - + + + + - + + @@ -18,8 +22,8 @@ - - + + - + @@ -87,8 +91,6 @@ - - diff --git a/Chapter5/5-2_WinePiano/WinePiano/SEManager.swift b/Chapter5/5-2_WinePiano/WinePiano/SEManager.swift index a229be1..3535fa9 100644 --- a/Chapter5/5-2_WinePiano/WinePiano/SEManager.swift +++ b/Chapter5/5-2_WinePiano/WinePiano/SEManager.swift @@ -13,10 +13,10 @@ class SEManager: NSObject { //音を制御するための変数 var player:AVAudioPlayer! //音を再生するsePlayメソッド - func sePlay(soundName: String){ - let path = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent(soundName) + func sePlay(_ soundName: String){ + let path = Bundle.main.bundleURL.appendingPathComponent(soundName) do { - try player = AVAudioPlayer(contentsOfURL: path) + try player = AVAudioPlayer(contentsOf: path) player.prepareToPlay() player.play() } @@ -24,4 +24,4 @@ class SEManager: NSObject { print("エラーです") } } -} \ No newline at end of file +} diff --git a/Chapter5/5-2_WinePiano/WinePiano/ViewController.swift b/Chapter5/5-2_WinePiano/WinePiano/ViewController.swift index 142cdd2..99be330 100644 --- a/Chapter5/5-2_WinePiano/WinePiano/ViewController.swift +++ b/Chapter5/5-2_WinePiano/WinePiano/ViewController.swift @@ -15,12 +15,12 @@ class ViewController: UIViewController { var wineGlass: AVAudioPlayer! //BGM再生メソッド - func play(soundName: String) { + func play(_ soundName: String) { //String型の引数からサウンドファイルを読み込む - let url = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent(soundName) + let url = Bundle.main.bundleURL.appendingPathComponent(soundName) do { //サウンドファイルの参照先をAVAudioPlayerの変数に割り当てる - try player = AVAudioPlayer(contentsOfURL: url) + try player = AVAudioPlayer(contentsOf: url) player.numberOfLoops = -1 //BGMを無限にループさせる player.prepareToPlay() //音声を即時再生させる player.play() //音を再生する @@ -39,14 +39,14 @@ class ViewController: UIViewController { } //ワイングラスボタンメソッド - @IBAction func wineTapped(sender: UIButton) { + @IBAction func wineTapped(_ sender: UIButton) { switch sender.tag { case 1: print("ワイングラスボタン\(sender.tag)") - let path = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent("1.mp3") + let path = Bundle.main.bundleURL.appendingPathComponent("1.mp3") do { //サウンドファイルの参照先をAVAudioPlayerの変数に割り当てる - try wineGlass = AVAudioPlayer(contentsOfURL: path) + try wineGlass = AVAudioPlayer(contentsOf: path) wineGlass.prepareToPlay() //音声を即時再生させる wineGlass.play() //音を再生する } @@ -56,10 +56,10 @@ class ViewController: UIViewController { case 2: print("ワイングラスボタン\(sender.tag)") - let path = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent("2.mp3") + let path = Bundle.main.bundleURL.appendingPathComponent("2.mp3") do { //サウンドファイルの参照先をAVAudioPlayerの変数に割り当てる - try wineGlass = AVAudioPlayer(contentsOfURL: path) + try wineGlass = AVAudioPlayer(contentsOf: path) wineGlass.prepareToPlay() //音声を即時再生させる wineGlass.play() //音を再生する } @@ -69,10 +69,10 @@ class ViewController: UIViewController { case 3: print("ワイングラスボタン\(sender.tag)") - let path = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent("3.mp3") + let path = Bundle.main.bundleURL.appendingPathComponent("3.mp3") do { //サウンドファイルの参照先をAVAudioPlayerの変数に割り当てる - try wineGlass = AVAudioPlayer(contentsOfURL: path) + try wineGlass = AVAudioPlayer(contentsOf: path) wineGlass.prepareToPlay() //音声を即時再生させる wineGlass.play() //音を再生する } @@ -82,10 +82,10 @@ class ViewController: UIViewController { case 4: print("ワイングラスボタン\(sender.tag)") - let path = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent("4.mp3") + let path = Bundle.main.bundleURL.appendingPathComponent("4.mp3") do { //サウンドファイルの参照先をAVAudioPlayerの変数に割り当てる - try wineGlass = AVAudioPlayer(contentsOfURL: path) + try wineGlass = AVAudioPlayer(contentsOf: path) wineGlass.prepareToPlay() //音声を即時再生させる wineGlass.play() //音を再生する } @@ -95,10 +95,10 @@ class ViewController: UIViewController { case 5: print("ワイングラスボタン\(sender.tag)") - let path = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent("5.mp3") + let path = Bundle.main.bundleURL.appendingPathComponent("5.mp3") do { //サウンドファイルの参照先をAVAudioPlayerの変数に割り当てる - try wineGlass = AVAudioPlayer(contentsOfURL: path) + try wineGlass = AVAudioPlayer(contentsOf: path) wineGlass.prepareToPlay() //音声を即時再生させる wineGlass.play() //音を再生する } diff --git a/Chapter5/5-3_WinePiano/WinePiano.xcodeproj/project.pbxproj b/Chapter5/5-3_WinePiano/WinePiano.xcodeproj/project.pbxproj index 359d629..a8039af 100644 --- a/Chapter5/5-3_WinePiano/WinePiano.xcodeproj/project.pbxproj +++ b/Chapter5/5-3_WinePiano/WinePiano.xcodeproj/project.pbxproj @@ -143,11 +143,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = KuwamuraHaruyoshi; TargetAttributes = { A4AE95CB1BE620FE008C6A3C = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0820; }; }; }; @@ -239,8 +240,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -283,8 +286,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -303,6 +308,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -315,6 +321,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onTheHammock.WinePiano; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -326,6 +333,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onTheHammock.WinePiano; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/Chapter5/5-3_WinePiano/WinePiano/AppDelegate.swift b/Chapter5/5-3_WinePiano/WinePiano/AppDelegate.swift index 9c544f4..07903f4 100644 --- a/Chapter5/5-3_WinePiano/WinePiano/AppDelegate.swift +++ b/Chapter5/5-3_WinePiano/WinePiano/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter5/5-3_WinePiano/WinePiano/Assets.xcassets/AppIcon.appiconset/Contents.json b/Chapter5/5-3_WinePiano/WinePiano/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..b8236c6 100644 --- a/Chapter5/5-3_WinePiano/WinePiano/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Chapter5/5-3_WinePiano/WinePiano/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", diff --git a/Chapter5/5-3_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard b/Chapter5/5-3_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard index 977ea30..9eb210b 100644 --- a/Chapter5/5-3_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard +++ b/Chapter5/5-3_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter5/5-3_WinePiano/WinePiano/Base.lproj/Main.storyboard b/Chapter5/5-3_WinePiano/WinePiano/Base.lproj/Main.storyboard index 81916b6..d37bcfd 100644 --- a/Chapter5/5-3_WinePiano/WinePiano/Base.lproj/Main.storyboard +++ b/Chapter5/5-3_WinePiano/WinePiano/Base.lproj/Main.storyboard @@ -1,9 +1,13 @@ - + + + + - + + @@ -57,7 +61,7 @@ - + @@ -87,8 +91,6 @@ - - diff --git a/Chapter5/5-3_WinePiano/WinePiano/SEManager.swift b/Chapter5/5-3_WinePiano/WinePiano/SEManager.swift index 270237c..0c8b799 100644 --- a/Chapter5/5-3_WinePiano/WinePiano/SEManager.swift +++ b/Chapter5/5-3_WinePiano/WinePiano/SEManager.swift @@ -14,12 +14,12 @@ class SEManager: NSObject, AVAudioPlayerDelegate { var soundArray = [AVAudioPlayer]() //音を再生するsePlayメソッド - func sePlay(soundName: String) { - let path = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent(soundName) + func sePlay(_ soundName: String) { + let path = Bundle.main.bundleURL.appendingPathComponent(soundName) var player: AVAudioPlayer! do { - try player = AVAudioPlayer(contentsOfURL: path) + try player = AVAudioPlayer(contentsOf: path) //配列soundArrayにplayerを追加 soundArray.append(player) player.delegate = self @@ -31,11 +31,11 @@ class SEManager: NSObject, AVAudioPlayerDelegate { } } //サウンドの再生後に実行されるメソッド - func audioPlayerDidFinishPlaying(player: AVAudioPlayer, successfully flag: Bool) { + func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) { //再生が終わった変数のインデックスを調べる - let i: Int = soundArray.indexOf(player)! + let i: Int = soundArray.index(of: player)! //上記で調べたインデックスの要素を削除する。 - soundArray.removeAtIndex(i) + soundArray.remove(at: i) } -} \ No newline at end of file +} diff --git a/Chapter5/5-3_WinePiano/WinePiano/ViewController.swift b/Chapter5/5-3_WinePiano/WinePiano/ViewController.swift index 1efb123..7f97a8a 100644 --- a/Chapter5/5-3_WinePiano/WinePiano/ViewController.swift +++ b/Chapter5/5-3_WinePiano/WinePiano/ViewController.swift @@ -17,12 +17,12 @@ class ViewController: UIViewController { var wineGlass: AVAudioPlayer! //BGM再生メソッド - func play(soundName: String) { + func play(_ soundName: String) { //String型の引数からサウンドファイルを読み込む - let url = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent(soundName) + let url = Bundle.main.bundleURL.appendingPathComponent(soundName) do { //サウンドファイルの参照先をAVAudioPlayerの変数に割り当てる - try player = AVAudioPlayer(contentsOfURL: url) + try player = AVAudioPlayer(contentsOf: url) player.numberOfLoops = -1 //BGMを無限にループさせる player.prepareToPlay() //音声を即時再生させる player.play() //音を再生する @@ -41,7 +41,7 @@ class ViewController: UIViewController { } //ワイングラスボタンメソッド - @IBAction func wineTapped(sender: UIButton) { + @IBAction func wineTapped(_ sender: UIButton) { //サウンドファイル名を格納するsound変数。初期値に空の文字を入れておく var sound:String = "" @@ -77,4 +77,4 @@ class ViewController: UIViewController { } -} \ No newline at end of file +} diff --git a/Chapter5/5-4_WinePiano/WinePiano.xcodeproj/project.pbxproj b/Chapter5/5-4_WinePiano/WinePiano.xcodeproj/project.pbxproj index eed2041..6ac7357 100644 --- a/Chapter5/5-4_WinePiano/WinePiano.xcodeproj/project.pbxproj +++ b/Chapter5/5-4_WinePiano/WinePiano.xcodeproj/project.pbxproj @@ -140,11 +140,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = KuwamuraHaruyoshi; TargetAttributes = { A4AE95CB1BE620FE008C6A3C = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0820; }; }; }; @@ -235,8 +236,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -279,8 +282,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -299,6 +304,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -311,6 +317,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onTheHammock.WinePiano; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -322,6 +329,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onTheHammock.WinePiano; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/Chapter5/5-4_WinePiano/WinePiano/AppDelegate.swift b/Chapter5/5-4_WinePiano/WinePiano/AppDelegate.swift index 9c544f4..07903f4 100644 --- a/Chapter5/5-4_WinePiano/WinePiano/AppDelegate.swift +++ b/Chapter5/5-4_WinePiano/WinePiano/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter5/5-4_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard b/Chapter5/5-4_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard index 977ea30..9eb210b 100644 --- a/Chapter5/5-4_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard +++ b/Chapter5/5-4_WinePiano/WinePiano/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter5/5-4_WinePiano/WinePiano/Base.lproj/Main.storyboard b/Chapter5/5-4_WinePiano/WinePiano/Base.lproj/Main.storyboard index 81916b6..d37bcfd 100644 --- a/Chapter5/5-4_WinePiano/WinePiano/Base.lproj/Main.storyboard +++ b/Chapter5/5-4_WinePiano/WinePiano/Base.lproj/Main.storyboard @@ -1,9 +1,13 @@ - + + + + - + + @@ -57,7 +61,7 @@ - + @@ -87,8 +91,6 @@ - - diff --git a/Chapter5/5-4_WinePiano/WinePiano/SEManager.swift b/Chapter5/5-4_WinePiano/WinePiano/SEManager.swift index 1e4120d..1f57c29 100644 --- a/Chapter5/5-4_WinePiano/WinePiano/SEManager.swift +++ b/Chapter5/5-4_WinePiano/WinePiano/SEManager.swift @@ -14,11 +14,11 @@ class SEManager: NSObject, AVAudioPlayerDelegate { //AVAudioPlayerを格納する空の配列を宣言 var soundArray = [AVAudioPlayer]() //音を再生するsePlayメソッド - func sePlay(soundName: String) { - let path = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent(soundName) + func sePlay(_ soundName: String) { + let path = Bundle.main.bundleURL.appendingPathComponent(soundName) var player: AVAudioPlayer! do { - try player = AVAudioPlayer(contentsOfURL: path) + try player = AVAudioPlayer(contentsOf: path) //配列soundArrayにplayerを追加 soundArray.append(player) player.delegate = self @@ -31,10 +31,10 @@ class SEManager: NSObject, AVAudioPlayerDelegate { } //サウンドの再生後に実行されるメソッド - func audioPlayerDidFinishPlaying(player: AVAudioPlayer, successfully flag: Bool) { + func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) { //再生が終わった変数のインデックスを調べる - let i: Int = soundArray.indexOf(player)! + let i: Int = soundArray.index(of: player)! //上記で調べたインデックスの要素を削除する。 - soundArray.removeAtIndex(i) + soundArray.remove(at: i) } -} \ No newline at end of file +} diff --git a/Chapter5/5-4_WinePiano/WinePiano/ViewController.swift b/Chapter5/5-4_WinePiano/WinePiano/ViewController.swift index 1c45ce6..ef90999 100644 --- a/Chapter5/5-4_WinePiano/WinePiano/ViewController.swift +++ b/Chapter5/5-4_WinePiano/WinePiano/ViewController.swift @@ -15,12 +15,12 @@ class ViewController: UIViewController { //ワイングラスの音を制御するための変数 var wineGlass: AVAudioPlayer! //BGM再生メソッド - func play(soundName: String) { + func play(_ soundName: String) { //String型の引数からサウンドファイルを読み込む - let url = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent(soundName) + let url = Bundle.main.bundleURL.appendingPathComponent(soundName) do { //サウンドファイルの参照先をAVAudioPlayerの変数に割り当てる - try player = AVAudioPlayer(contentsOfURL: url) + try player = AVAudioPlayer(contentsOf: url) player.numberOfLoops = -1 //BGMを無限にループさせる player.prepareToPlay() //音声を即時再生させる player.play() //音を再生する @@ -38,11 +38,11 @@ class ViewController: UIViewController { } //ワイングラスボタンメソッド - @IBAction func wineTapped(sender: UIButton) { + @IBAction func wineTapped(_ sender: UIButton) { //サウンドファイル名を格納するsound変数。初期値に空の文字を入れておく var sound:String = "" //変形を設定するCGAffinTransformの変数 - var transform: CGAffineTransform = CGAffineTransformIdentity + var transform: CGAffineTransform = CGAffineTransform.identity //アニメーションの所要時間を持つ変数 let duration: Double = 0.5 switch sender.tag { @@ -50,47 +50,47 @@ class ViewController: UIViewController { print("ワイングラスボタン\(sender.tag)") sound = "1.mp3" //上に移動 - transform = CGAffineTransformMakeTranslation(0, -20) + transform = CGAffineTransform(translationX: 0, y: -20) case 2: print("ワイングラスボタン\(sender.tag)") sound = "2.mp3" //拡大 - transform = CGAffineTransformMakeScale(1.05, 1.05) + transform = CGAffineTransform(scaleX: 1.05, y: 1.05) case 3: print("ワイングラスボタン\(sender.tag)") sound = "3.mp3" //回転 - transform = CGAffineTransformMakeRotation(CGFloat(0.25*M_PI)) + transform = CGAffineTransform(rotationAngle: CGFloat(0.25*M_PI)) case 4: print("ワイングラスボタン\(sender.tag)") sound = "4.mp3" //縮小 - transform = CGAffineTransformMakeScale(0.95, 0.95) + transform = CGAffineTransform(scaleX: 0.95, y: 0.95) case 5: print("ワイングラスボタン\(sender.tag)") sound = "5.mp3" //反転 - transform = CGAffineTransformMakeScale(-1, 1) + transform = CGAffineTransform(scaleX: -1, y: 1) default: print("どのボタンでもありません") } //引数にsound変数を設定して、SEManagerクラスのsePlayメソッドを呼び出す soundManager.sePlay(sound) //アニメーション - UIView.animateWithDuration(duration, animations: { () -> Void in + UIView.animate(withDuration: duration, animations: { () -> Void in sender.transform = transform - }) - { (Bool) -> Void in - UIView.animateWithDuration(duration, animations: { () -> Void in - sender.transform = CGAffineTransformIdentity - }) - { (Bool) -> Void in - } - } + }, completion: { (Bool) -> Void in + UIView.animate(withDuration: duration, animations: { () -> Void in + sender.transform = CGAffineTransform.identity + }, completion: { (Bool) -> Void in + }) + + }) + } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } -} \ No newline at end of file +} diff --git a/Chapter6/Chapter6-1/Calculator/Calculator.xcodeproj/project.pbxproj b/Chapter6/Chapter6-1/Calculator/Calculator.xcodeproj/project.pbxproj index 1b282e4..12c135e 100644 --- a/Chapter6/Chapter6-1/Calculator/Calculator.xcodeproj/project.pbxproj +++ b/Chapter6/Chapter6-1/Calculator/Calculator.xcodeproj/project.pbxproj @@ -188,18 +188,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9ECC47061C15C8560039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; }; 9ECC471A1C15C8560039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9ECC47061C15C8560039DE4D; }; 9ECC47251C15C8560039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9ECC47061C15C8560039DE4D; }; }; @@ -325,8 +328,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -369,8 +374,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -389,6 +396,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -401,6 +409,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.Calculator; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -412,6 +421,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.Calculator; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -423,6 +433,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Calculator.app/Calculator"; }; name = Debug; @@ -435,6 +446,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Calculator.app/Calculator"; }; name = Release; @@ -446,6 +458,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = Calculator; USES_XCTRUNNER = YES; }; @@ -458,6 +471,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = Calculator; USES_XCTRUNNER = YES; }; @@ -482,6 +496,7 @@ 9ECC47311C15C8560039DE4D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9ECC47321C15C8560039DE4D /* Build configuration list for PBXNativeTarget "CalculatorTests" */ = { isa = XCConfigurationList; @@ -490,6 +505,7 @@ 9ECC47341C15C8560039DE4D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9ECC47351C15C8560039DE4D /* Build configuration list for PBXNativeTarget "CalculatorUITests" */ = { isa = XCConfigurationList; @@ -498,6 +514,7 @@ 9ECC47371C15C8560039DE4D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Chapter6/Chapter6-1/Calculator/Calculator/AppDelegate.swift b/Chapter6/Chapter6-1/Calculator/Calculator/AppDelegate.swift index a4cecb3..b2ca252 100644 --- a/Chapter6/Chapter6-1/Calculator/Calculator/AppDelegate.swift +++ b/Chapter6/Chapter6-1/Calculator/Calculator/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter6/Chapter6-1/Calculator/Calculator/Assets.xcassets/AppIcon.appiconset/Contents.json b/Chapter6/Chapter6-1/Calculator/Calculator/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..b8236c6 100644 --- a/Chapter6/Chapter6-1/Calculator/Calculator/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Chapter6/Chapter6-1/Calculator/Calculator/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", diff --git a/Chapter6/Chapter6-1/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard b/Chapter6/Chapter6-1/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard index 977ea30..1d03c2d 100644 --- a/Chapter6/Chapter6-1/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard +++ b/Chapter6/Chapter6-1/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter6/Chapter6-1/Calculator/Calculator/Base.lproj/Main.storyboard b/Chapter6/Chapter6-1/Calculator/Calculator/Base.lproj/Main.storyboard index 1d4fab2..b129019 100644 --- a/Chapter6/Chapter6-1/Calculator/Calculator/Base.lproj/Main.storyboard +++ b/Chapter6/Chapter6-1/Calculator/Calculator/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter6/Chapter6-1/Calculator/Calculator/ViewController.swift b/Chapter6/Chapter6-1/Calculator/Calculator/ViewController.swift index 7235e6a..4a29bd9 100644 --- a/Chapter6/Chapter6-1/Calculator/Calculator/ViewController.swift +++ b/Chapter6/Chapter6-1/Calculator/Calculator/ViewController.swift @@ -16,9 +16,9 @@ class ViewController: UIViewController { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. //画面の横幅のサイズを格納するメンバ変数 - let screenWidth:Double = Double(UIScreen.mainScreen().bounds.size.width) + let screenWidth:Double = Double(UIScreen.main.bounds.size.width) //画面の縦幅 - let screenHeight:Double = Double(UIScreen.mainScreen().bounds.size.height) + let screenHeight:Double = Double(UIScreen.main.bounds.size.height) //ボタン間の余白(縦) & (横) let buttonMargin = 10.0 // 計算結果表示エリアの縦幅 @@ -40,11 +40,11 @@ class ViewController: UIViewController { resultLabel.frame = CGRect(x: 10, y: 30, width: screenWidth - 20, height: resultArea - 30) //計算結果ラベルの背景色を灰色にする - resultLabel.backgroundColor = UIColor.grayColor() + resultLabel.backgroundColor = UIColor.gray //計算結果ラベルのフォントと文字サイズを設定 resultLabel.font = UIFont(name: "Arial", size: 50) //計算結果ラベルのアラインメントを右揃えに設定 - resultLabel.textAlignment = NSTextAlignment.Right + resultLabel.textAlignment = NSTextAlignment.right //計算結果ラベルの表示行数を4行に設定 resultLabel.numberOfLines = 4 //計算結果ラベルの初期値を"0"に設定 @@ -60,8 +60,8 @@ class ViewController: UIViewController { "0","C","÷","=" ] - for var y = 0; y < yButtonCount; y++ { - for var x = 0; x < xButtonCount; x++ { + for y in 0 ..< yButtonCount { + for x in 0 ..< xButtonCount { //計算機のボタンを作成 let button = UIButton() // ボタンの横幅サイズ作成 @@ -75,11 +75,11 @@ class ViewController: UIViewController { // ボタンの縦幅サイズ作成 button.frame = CGRect(x:buttonPositionX,y: buttonPositionY, width:buttonWidth,height:buttonHeight) // ボタン背景色設定 - button.backgroundColor = UIColor.greenColor() + button.backgroundColor = UIColor.green //ボタンのラベルタイトルを取り出すインデックス番号 let buttonNumber = y * xButtonCount + x //ボタンのラベルタイトルを設定 - button.setTitle(buttonLabels[buttonNumber], forState: UIControlState.Normal) + button.setTitle(buttonLabels[buttonNumber], for: UIControlState()) // ボタン配置 self.view.addSubview(button) diff --git a/Chapter6/Chapter6-1/Calculator/CalculatorTests/CalculatorTests.swift b/Chapter6/Chapter6-1/Calculator/CalculatorTests/CalculatorTests.swift index 903b3da..2de4b99 100644 --- a/Chapter6/Chapter6-1/Calculator/CalculatorTests/CalculatorTests.swift +++ b/Chapter6/Chapter6-1/Calculator/CalculatorTests/CalculatorTests.swift @@ -28,7 +28,7 @@ class CalculatorTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter6/Chapter6-2/Calculator/Calculator.xcodeproj/project.pbxproj b/Chapter6/Chapter6-2/Calculator/Calculator.xcodeproj/project.pbxproj index 1b282e4..12c135e 100644 --- a/Chapter6/Chapter6-2/Calculator/Calculator.xcodeproj/project.pbxproj +++ b/Chapter6/Chapter6-2/Calculator/Calculator.xcodeproj/project.pbxproj @@ -188,18 +188,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9ECC47061C15C8560039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; }; 9ECC471A1C15C8560039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9ECC47061C15C8560039DE4D; }; 9ECC47251C15C8560039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9ECC47061C15C8560039DE4D; }; }; @@ -325,8 +328,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -369,8 +374,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -389,6 +396,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -401,6 +409,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.Calculator; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -412,6 +421,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.Calculator; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -423,6 +433,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Calculator.app/Calculator"; }; name = Debug; @@ -435,6 +446,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Calculator.app/Calculator"; }; name = Release; @@ -446,6 +458,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = Calculator; USES_XCTRUNNER = YES; }; @@ -458,6 +471,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = Calculator; USES_XCTRUNNER = YES; }; @@ -482,6 +496,7 @@ 9ECC47311C15C8560039DE4D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9ECC47321C15C8560039DE4D /* Build configuration list for PBXNativeTarget "CalculatorTests" */ = { isa = XCConfigurationList; @@ -490,6 +505,7 @@ 9ECC47341C15C8560039DE4D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9ECC47351C15C8560039DE4D /* Build configuration list for PBXNativeTarget "CalculatorUITests" */ = { isa = XCConfigurationList; @@ -498,6 +514,7 @@ 9ECC47371C15C8560039DE4D /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Chapter6/Chapter6-2/Calculator/Calculator/AppDelegate.swift b/Chapter6/Chapter6-2/Calculator/Calculator/AppDelegate.swift index a4cecb3..b2ca252 100644 --- a/Chapter6/Chapter6-2/Calculator/Calculator/AppDelegate.swift +++ b/Chapter6/Chapter6-2/Calculator/Calculator/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter6/Chapter6-2/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard b/Chapter6/Chapter6-2/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard index 977ea30..1d03c2d 100644 --- a/Chapter6/Chapter6-2/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard +++ b/Chapter6/Chapter6-2/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter6/Chapter6-2/Calculator/Calculator/Base.lproj/Main.storyboard b/Chapter6/Chapter6-2/Calculator/Calculator/Base.lproj/Main.storyboard index 1d4fab2..b129019 100644 --- a/Chapter6/Chapter6-2/Calculator/Calculator/Base.lproj/Main.storyboard +++ b/Chapter6/Chapter6-2/Calculator/Calculator/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter6/Chapter6-2/Calculator/Calculator/ViewController.swift b/Chapter6/Chapter6-2/Calculator/Calculator/ViewController.swift index bf24c09..e450036 100644 --- a/Chapter6/Chapter6-2/Calculator/Calculator/ViewController.swift +++ b/Chapter6/Chapter6-2/Calculator/Calculator/ViewController.swift @@ -22,9 +22,9 @@ class ViewController: UIViewController { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. //画面の横幅のサイズを格納するメンバ変数 - let screenWidth:Double = Double(UIScreen.mainScreen().bounds.size.width) + let screenWidth:Double = Double(UIScreen.main.bounds.size.width) //画面の縦幅 - let screenHeight:Double = Double(UIScreen.mainScreen().bounds.size.height) + let screenHeight:Double = Double(UIScreen.main.bounds.size.height) //ボタン間の余白(縦) & (横) let buttonMargin = 10.0 // 計算結果表示エリアの縦幅 @@ -46,11 +46,11 @@ class ViewController: UIViewController { resultLabel.frame = CGRect(x: 10, y: 30, width: screenWidth - 20, height: resultArea - 30) //計算結果ラベルの背景色を灰色にする - resultLabel.backgroundColor = UIColor.grayColor() + resultLabel.backgroundColor = UIColor.gray //計算結果ラベルのフォントと文字サイズを設定 resultLabel.font = UIFont(name: "Arial", size: 50) //計算結果ラベルのアラインメントを右揃えに設定 - resultLabel.textAlignment = NSTextAlignment.Right + resultLabel.textAlignment = NSTextAlignment.right //計算結果ラベルの表示行数を4行に設定 resultLabel.numberOfLines = 4 //計算結果ラベルの初期値を"0"に設定 @@ -66,8 +66,8 @@ class ViewController: UIViewController { "0","C","÷","=" ] - for var y = 0; y < yButtonCount; y++ { - for var x = 0; x < xButtonCount; x++ { + for y in 0 ..< yButtonCount { + for x in 0 ..< xButtonCount { //計算機のボタンを作成 let button = UIButton() // ボタンの横幅サイズ作成 @@ -82,13 +82,13 @@ class ViewController: UIViewController { // ボタンの縦幅サイズ作成 button.frame = CGRect(x:buttonPositionX,y: buttonPositionY, width:buttonWidth,height:buttonHeight) // ボタン背景色設定 - button.backgroundColor = UIColor.greenColor() + button.backgroundColor = UIColor.green //ボタンのラベルタイトルを取り出すインデックス番号 let buttonNumber = y * xButtonCount + x //ボタンのラベルタイトルを設定 - button.setTitle(buttonLabels[buttonNumber], forState: UIControlState.Normal) + button.setTitle(buttonLabels[buttonNumber], for: UIControlState()) // ボタンタップ時のアクション設定 - button.addTarget(self, action: "buttonTapped:", forControlEvents: UIControlEvents.TouchUpInside) + button.addTarget(self, action: #selector(ViewController.buttonTapped(_:)), for: UIControlEvents.touchUpInside) // ボタン配置 self.view.addSubview(button) @@ -100,7 +100,7 @@ class ViewController: UIViewController { } // ボタンがタップされた時のメソッド - func buttonTapped(sender:UIButton){ + func buttonTapped(_ sender:UIButton){ let tappedButtonTitle:String = sender.currentTitle! print("\(tappedButtonTitle)ボタンが押されました!") // ボタンのタイトルで条件分岐 @@ -115,37 +115,37 @@ class ViewController: UIViewController { clearButtonTapped(tappedButtonTitle) } } - func numberButtonTapped(tappedButtonTitle:String){ + func numberButtonTapped(_ tappedButtonTitle:String){ print("数字ボタンタップ:\(tappedButtonTitle)") // タップされた数字タイトルを計算できるようにNSDecimalNumber型に変換 let tappedButtonNum:NSDecimalNumber = NSDecimalNumber(string: tappedButtonTitle) // 入力されていた値を10倍にして1桁大きくして、その変換した数値を加算 - number1 = number1.decimalNumberByMultiplyingBy (NSDecimalNumber(string: "10")).decimalNumberByAdding(tappedButtonNum) + number1 = number1.multiplying (by: NSDecimalNumber(string: "10")).adding(tappedButtonNum) // 計算結果ラベルに表示 resultLabel.text = number1.stringValue } - func operatorButtonTapped(tappedButtonTitle:String){ + func operatorButtonTapped(_ tappedButtonTitle:String){ print("演算子ボタンタップ:\(tappedButtonTitle)") operatorId = tappedButtonTitle number2 = number1 number1 = NSDecimalNumber(string: "0") } - func equalButtonTapped(tappedButtonTitle:String){ + func equalButtonTapped(_ tappedButtonTitle:String){ print("等号ボタンタップ:\(tappedButtonTitle)") switch operatorId { case "+": - result = number2.decimalNumberByAdding(number1) + result = number2.adding(number1) case "-": - result = number2.decimalNumberBySubtracting(number1) + result = number2.subtracting(number1) case "×": - result = number2.decimalNumberByMultiplyingBy(number1) + result = number2.multiplying(by: number1) case "÷": - if(number1.isEqualToNumber(0)){ + if(number1.isEqual(to: 0)){ number1 = 0 resultLabel.text = "無限大" return } else { - result = number2.decimalNumberByDividingBy(number1) + result = number2.dividing(by: number1) } default: print("その他") @@ -153,7 +153,7 @@ class ViewController: UIViewController { number1 = result resultLabel.text = String("\(result)") } - func clearButtonTapped(tappedButtonTitle:String){ + func clearButtonTapped(_ tappedButtonTitle:String){ print("クリアボタンタップ:\(tappedButtonTitle)") number1 = NSDecimalNumber(string: "0") number2 = NSDecimalNumber(string: "0") diff --git a/Chapter6/Chapter6-2/Calculator/CalculatorTests/CalculatorTests.swift b/Chapter6/Chapter6-2/Calculator/CalculatorTests/CalculatorTests.swift index 903b3da..2de4b99 100644 --- a/Chapter6/Chapter6-2/Calculator/CalculatorTests/CalculatorTests.swift +++ b/Chapter6/Chapter6-2/Calculator/CalculatorTests/CalculatorTests.swift @@ -28,7 +28,7 @@ class CalculatorTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter6/Chapter6-3/Calculator/Calculator.xcodeproj/project.pbxproj b/Chapter6/Chapter6-3/Calculator/Calculator.xcodeproj/project.pbxproj index 4c5d18d..71837bd 100644 --- a/Chapter6/Chapter6-3/Calculator/Calculator.xcodeproj/project.pbxproj +++ b/Chapter6/Chapter6-3/Calculator/Calculator.xcodeproj/project.pbxproj @@ -202,18 +202,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0710; - LastUpgradeCheck = 0710; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9ECC47061C15C8560039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; }; 9ECC471A1C15C8560039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9ECC47061C15C8560039DE4D; }; 9ECC47251C15C8560039DE4D = { CreatedOnToolsVersion = 7.1.1; + LastSwiftMigration = 0820; TestTargetID = 9ECC47061C15C8560039DE4D; }; }; @@ -341,8 +344,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -385,8 +390,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -405,6 +412,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.1; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -417,6 +425,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.Calculator; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -428,6 +437,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.Calculator; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -439,6 +449,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Calculator.app/Calculator"; }; name = Debug; @@ -451,6 +462,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Calculator.app/Calculator"; }; name = Release; @@ -462,6 +474,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = Calculator; USES_XCTRUNNER = YES; }; @@ -474,6 +487,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.CalculatorUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = Calculator; USES_XCTRUNNER = YES; }; diff --git a/Chapter6/Chapter6-3/Calculator/Calculator/AppDelegate.swift b/Chapter6/Chapter6-3/Calculator/Calculator/AppDelegate.swift index 0f56e4b..e1511e8 100644 --- a/Chapter6/Chapter6-3/Calculator/Calculator/AppDelegate.swift +++ b/Chapter6/Chapter6-3/Calculator/Calculator/AppDelegate.swift @@ -14,32 +14,32 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. // ステータスバーのテキストカラー - UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent + UIApplication.shared.statusBarStyle = UIStatusBarStyle.lightContent return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter6/Chapter6-3/Calculator/Calculator/Assets.xcassets/AppIcon.appiconset/Contents.json b/Chapter6/Chapter6-3/Calculator/Calculator/Assets.xcassets/AppIcon.appiconset/Contents.json index 7e1afb0..bede15b 100644 --- a/Chapter6/Chapter6-3/Calculator/Calculator/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Chapter6/Chapter6-3/Calculator/Calculator/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", diff --git a/Chapter6/Chapter6-3/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard b/Chapter6/Chapter6-3/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard index 977ea30..1d03c2d 100644 --- a/Chapter6/Chapter6-3/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard +++ b/Chapter6/Chapter6-3/Calculator/Calculator/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter6/Chapter6-3/Calculator/Calculator/Base.lproj/Main.storyboard b/Chapter6/Chapter6-3/Calculator/Calculator/Base.lproj/Main.storyboard index 1d4fab2..b129019 100644 --- a/Chapter6/Chapter6-3/Calculator/Calculator/Base.lproj/Main.storyboard +++ b/Chapter6/Chapter6-3/Calculator/Calculator/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter6/Chapter6-3/Calculator/Calculator/ViewController.swift b/Chapter6/Chapter6-3/Calculator/Calculator/ViewController.swift index e74d6ce..3d56572 100644 --- a/Chapter6/Chapter6-3/Calculator/Calculator/ViewController.swift +++ b/Chapter6/Chapter6-3/Calculator/Calculator/ViewController.swift @@ -24,11 +24,11 @@ class ViewController: UIViewController { // Do any additional setup after loading the view, typically from a nib. //画面の背景色を設定 - self.view.backgroundColor = UIColor.blackColor() + self.view.backgroundColor = UIColor.black //画面の横幅のサイズを格納するメンバ変数 - let screenWidth:Double = Double(UIScreen.mainScreen().bounds.size.width) + let screenWidth:Double = Double(UIScreen.main.bounds.size.width) //画面の縦幅 - let screenHeight:Double = Double(UIScreen.mainScreen().bounds.size.height) + let screenHeight:Double = Double(UIScreen.main.bounds.size.height) //ボタン間の余白(縦) & (横) let buttonMargin = 10.0 // 計算結果表示エリアの縦幅 @@ -54,7 +54,7 @@ class ViewController: UIViewController { //計算結果ラベルのフォントと文字サイズを設定 resultLabel.font = UIFont(name: "Arial", size: 50) //計算結果ラベルのアラインメントを右揃えに設定 - resultLabel.textAlignment = NSTextAlignment.Right + resultLabel.textAlignment = NSTextAlignment.right //計算結果ラベルの表示行数を4行に設定 resultLabel.numberOfLines = 4 //計算結果ラベルの初期値を"0"に設定 @@ -72,8 +72,8 @@ class ViewController: UIViewController { "0","C","÷","=" ] - for var y = 0; y < yButtonCount; y++ { - for var x = 0; x < xButtonCount; x++ { + for y in 0 ..< yButtonCount { + for x in 0 ..< xButtonCount { //計算機のボタンを作成 let button = UIButton() // ボタンの横幅サイズ作成 @@ -91,21 +91,21 @@ class ViewController: UIViewController { //ボタン背景をグラデーション色設定 let gradient = CAGradientLayer() gradient.frame = button.bounds - let arrayColors = [ colorWithRGBHex(0xFFFFFF, alpha: 1.0).CGColor as AnyObject, colorWithRGBHex(0xCCCCCC, alpha: 1.0).CGColor as AnyObject] + let arrayColors = [ colorWithRGBHex(0xFFFFFF, alpha: 1.0).cgColor as AnyObject, colorWithRGBHex(0xCCCCCC, alpha: 1.0).cgColor as AnyObject] gradient.colors = arrayColors - button.layer.insertSublayer(gradient, atIndex: 0) + button.layer.insertSublayer(gradient, at: 0) //ボタンを角丸にする button.layer.masksToBounds = true button.layer.cornerRadius = 5.0 // ボタンのテキストカラーを設定 - button.setTitleColor(UIColor.blackColor(),forState: UIControlState.Normal) - button.setTitleColor(UIColor.grayColor(),forState:UIControlState.Highlighted) + button.setTitleColor(UIColor.black,for: UIControlState()) + button.setTitleColor(UIColor.gray,for:UIControlState.highlighted) //ボタンのラベルタイトルを取り出すインデックス番号 let buttonNumber = y * xButtonCount + x //ボタンのラベルタイトルを設定 - button.setTitle(buttonLabels[buttonNumber], forState: UIControlState.Normal) + button.setTitle(buttonLabels[buttonNumber], for: UIControlState()) // ボタンタップ時のアクション設定 - button.addTarget(self, action: "buttonTapped:", forControlEvents: UIControlEvents.TouchUpInside) + button.addTarget(self, action: #selector(ViewController.buttonTapped(_:)), for: UIControlEvents.touchUpInside) // ボタン配置 self.view.addSubview(button) } @@ -115,7 +115,7 @@ class ViewController: UIViewController { } // ボタンがタップされた時のメソッド - func buttonTapped(sender:UIButton){ + func buttonTapped(_ sender:UIButton){ let tappedButtonTitle:String = sender.currentTitle! print("\(tappedButtonTitle)ボタンが押されました!") // ボタンのタイトルで条件分岐 @@ -130,37 +130,37 @@ class ViewController: UIViewController { clearButtonTapped(tappedButtonTitle) } } - func numberButtonTapped(tappedButtonTitle:String){ + func numberButtonTapped(_ tappedButtonTitle:String){ print("数字ボタンタップ:\(tappedButtonTitle)") // タップされた数字タイトルを計算できるようにNSDecimalNumber型に変換 let tappedButtonNum:NSDecimalNumber = NSDecimalNumber(string: tappedButtonTitle) // 入力されていた値を10倍にして1桁大きくして、その変換した数値を加算 - number1 = number1.decimalNumberByMultiplyingBy (NSDecimalNumber(string: "10")).decimalNumberByAdding(tappedButtonNum) + number1 = number1.multiplying (by: NSDecimalNumber(string: "10")).adding(tappedButtonNum) // 計算結果ラベルに表示 resultLabel.text = number1.stringValue } - func operatorButtonTapped(tappedButtonTitle:String){ + func operatorButtonTapped(_ tappedButtonTitle:String){ print("演算子ボタンタップ:\(tappedButtonTitle)") operatorId = tappedButtonTitle number2 = number1 number1 = NSDecimalNumber(string: "0") } - func equalButtonTapped(tappedButtonTitle:String){ + func equalButtonTapped(_ tappedButtonTitle:String){ print("等号ボタンタップ:\(tappedButtonTitle)") switch operatorId { case "+": - result = number2.decimalNumberByAdding(number1) + result = number2.adding(number1) case "-": - result = number2.decimalNumberBySubtracting(number1) + result = number2.subtracting(number1) case "×": - result = number2.decimalNumberByMultiplyingBy(number1) + result = number2.multiplying(by: number1) case "÷": - if(number1.isEqualToNumber(0)){ + if(number1.isEqual(to: 0)){ number1 = 0 resultLabel.text = "無限大" return } else { - result = number2.decimalNumberByDividingBy(number1) + result = number2.dividing(by: number1) } default: print("その他") @@ -168,7 +168,7 @@ class ViewController: UIViewController { number1 = result resultLabel.text = String("\(result)") } - func clearButtonTapped(tappedButtonTitle:String){ + func clearButtonTapped(_ tappedButtonTitle:String){ print("クリアボタンタップ:\(tappedButtonTitle)") number1 = NSDecimalNumber(string: "0") number2 = NSDecimalNumber(string: "0") @@ -177,7 +177,7 @@ class ViewController: UIViewController { resultLabel.text = "0" } // HEX値で設定メソッド - func colorWithRGBHex(hex: Int, alpha: Float = 1.0) -> UIColor { + func colorWithRGBHex(_ hex: Int, alpha: Float = 1.0) -> UIColor { let r = Float((hex >> 16) & 0xFF) let g = Float((hex >> 8) & 0xFF) let b = Float((hex) & 0xFF) diff --git a/Chapter6/Chapter6-3/Calculator/CalculatorTests/CalculatorTests.swift b/Chapter6/Chapter6-3/Calculator/CalculatorTests/CalculatorTests.swift index 903b3da..2de4b99 100644 --- a/Chapter6/Chapter6-3/Calculator/CalculatorTests/CalculatorTests.swift +++ b/Chapter6/Chapter6-3/Calculator/CalculatorTests/CalculatorTests.swift @@ -28,7 +28,7 @@ class CalculatorTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter7/Chapter7-1/Modal/Modal.xcodeproj/project.pbxproj b/Chapter7/Chapter7-1/Modal/Modal.xcodeproj/project.pbxproj index 84637b2..0997adf 100644 --- a/Chapter7/Chapter7-1/Modal/Modal.xcodeproj/project.pbxproj +++ b/Chapter7/Chapter7-1/Modal/Modal.xcodeproj/project.pbxproj @@ -188,18 +188,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9E8378481C1D3107000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; }; 9E83785C1C1D3107000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; TestTargetID = 9E8378481C1D3107000A5220; }; 9E8378671C1D3107000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; TestTargetID = 9E8378481C1D3107000A5220; }; }; @@ -325,8 +328,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -369,8 +374,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -389,6 +396,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -401,6 +409,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.Modal; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -412,6 +421,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.Modal; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -423,6 +433,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ModalTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Modal.app/Modal"; }; name = Debug; @@ -435,6 +446,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ModalTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Modal.app/Modal"; }; name = Release; @@ -446,6 +458,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ModalUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = Modal; USES_XCTRUNNER = YES; }; @@ -458,6 +471,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.ModalUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = Modal; USES_XCTRUNNER = YES; }; @@ -482,6 +496,7 @@ 9E8378731C1D3107000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9E8378741C1D3107000A5220 /* Build configuration list for PBXNativeTarget "ModalTests" */ = { isa = XCConfigurationList; @@ -490,6 +505,7 @@ 9E8378761C1D3107000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9E8378771C1D3107000A5220 /* Build configuration list for PBXNativeTarget "ModalUITests" */ = { isa = XCConfigurationList; @@ -498,6 +514,7 @@ 9E8378791C1D3107000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Chapter7/Chapter7-1/Modal/Modal/AppDelegate.swift b/Chapter7/Chapter7-1/Modal/Modal/AppDelegate.swift index 020f7d6..fc9cab5 100644 --- a/Chapter7/Chapter7-1/Modal/Modal/AppDelegate.swift +++ b/Chapter7/Chapter7-1/Modal/Modal/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter7/Chapter7-1/Modal/Modal/Base.lproj/LaunchScreen.storyboard b/Chapter7/Chapter7-1/Modal/Modal/Base.lproj/LaunchScreen.storyboard index 977ea30..1d03c2d 100644 --- a/Chapter7/Chapter7-1/Modal/Modal/Base.lproj/LaunchScreen.storyboard +++ b/Chapter7/Chapter7-1/Modal/Modal/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter7/Chapter7-1/Modal/Modal/Base.lproj/Main.storyboard b/Chapter7/Chapter7-1/Modal/Modal/Base.lproj/Main.storyboard index d070702..a0404cd 100644 --- a/Chapter7/Chapter7-1/Modal/Modal/Base.lproj/Main.storyboard +++ b/Chapter7/Chapter7-1/Modal/Modal/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,18 +18,18 @@ - + - + @@ -44,9 +48,9 @@ - + - + diff --git a/Chapter7/Chapter7-1/Modal/ModalTests/ModalTests.swift b/Chapter7/Chapter7-1/Modal/ModalTests/ModalTests.swift index 051d505..6c5f2ff 100644 --- a/Chapter7/Chapter7-1/Modal/ModalTests/ModalTests.swift +++ b/Chapter7/Chapter7-1/Modal/ModalTests/ModalTests.swift @@ -28,7 +28,7 @@ class ModalTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter7/Chapter7-1/Navigation/Navigation.xcodeproj/project.pbxproj b/Chapter7/Chapter7-1/Navigation/Navigation.xcodeproj/project.pbxproj index a1c72d9..809a03e 100644 --- a/Chapter7/Chapter7-1/Navigation/Navigation.xcodeproj/project.pbxproj +++ b/Chapter7/Chapter7-1/Navigation/Navigation.xcodeproj/project.pbxproj @@ -188,18 +188,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9E8378821C1D348C000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; }; 9E8378961C1D348C000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; TestTargetID = 9E8378821C1D348C000A5220; }; 9E8378A11C1D348C000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; TestTargetID = 9E8378821C1D348C000A5220; }; }; @@ -325,8 +328,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -369,8 +374,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -389,6 +396,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -401,6 +409,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.Navigation; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -412,6 +421,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.Navigation; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -423,6 +433,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.NavigationTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Navigation.app/Navigation"; }; name = Debug; @@ -435,6 +446,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.NavigationTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Navigation.app/Navigation"; }; name = Release; @@ -446,6 +458,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.NavigationUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = Navigation; USES_XCTRUNNER = YES; }; @@ -458,6 +471,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.NavigationUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = Navigation; USES_XCTRUNNER = YES; }; @@ -482,6 +496,7 @@ 9E8378AD1C1D348C000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9E8378AE1C1D348C000A5220 /* Build configuration list for PBXNativeTarget "NavigationTests" */ = { isa = XCConfigurationList; @@ -490,6 +505,7 @@ 9E8378B01C1D348C000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9E8378B11C1D348C000A5220 /* Build configuration list for PBXNativeTarget "NavigationUITests" */ = { isa = XCConfigurationList; @@ -498,6 +514,7 @@ 9E8378B31C1D348C000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Chapter7/Chapter7-1/Navigation/Navigation/AppDelegate.swift b/Chapter7/Chapter7-1/Navigation/Navigation/AppDelegate.swift index 65fd13f..d7f0630 100644 --- a/Chapter7/Chapter7-1/Navigation/Navigation/AppDelegate.swift +++ b/Chapter7/Chapter7-1/Navigation/Navigation/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter7/Chapter7-1/Navigation/Navigation/Base.lproj/Main.storyboard b/Chapter7/Chapter7-1/Navigation/Navigation/Base.lproj/Main.storyboard index e37695d..e858b35 100644 --- a/Chapter7/Chapter7-1/Navigation/Navigation/Base.lproj/Main.storyboard +++ b/Chapter7/Chapter7-1/Navigation/Navigation/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,18 +18,18 @@ - + - + @@ -46,9 +50,9 @@ - + - + diff --git a/Chapter7/Chapter7-1/Navigation/NavigationTests/NavigationTests.swift b/Chapter7/Chapter7-1/Navigation/NavigationTests/NavigationTests.swift index c348562..977c1ec 100644 --- a/Chapter7/Chapter7-1/Navigation/NavigationTests/NavigationTests.swift +++ b/Chapter7/Chapter7-1/Navigation/NavigationTests/NavigationTests.swift @@ -28,7 +28,7 @@ class NavigationTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter7/Chapter7-1/TabBar/TabBar.xcodeproj/project.pbxproj b/Chapter7/Chapter7-1/TabBar/TabBar.xcodeproj/project.pbxproj index 27b2a70..106dd57 100644 --- a/Chapter7/Chapter7-1/TabBar/TabBar.xcodeproj/project.pbxproj +++ b/Chapter7/Chapter7-1/TabBar/TabBar.xcodeproj/project.pbxproj @@ -188,18 +188,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9E8378BC1C1D36B6000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; }; 9E8378D01C1D36B6000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; TestTargetID = 9E8378BC1C1D36B6000A5220; }; 9E8378DB1C1D36B6000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; TestTargetID = 9E8378BC1C1D36B6000A5220; }; }; @@ -325,8 +328,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -369,8 +374,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -389,6 +396,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -401,6 +409,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.TabBar; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -412,6 +421,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.TabBar; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -423,6 +433,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.TabBarTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TabBar.app/TabBar"; }; name = Debug; @@ -435,6 +446,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.TabBarTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TabBar.app/TabBar"; }; name = Release; @@ -446,6 +458,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.TabBarUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = TabBar; USES_XCTRUNNER = YES; }; @@ -458,6 +471,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.TabBarUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = TabBar; USES_XCTRUNNER = YES; }; @@ -482,6 +496,7 @@ 9E8378E71C1D36B6000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9E8378E81C1D36B6000A5220 /* Build configuration list for PBXNativeTarget "TabBarTests" */ = { isa = XCConfigurationList; @@ -490,6 +505,7 @@ 9E8378EA1C1D36B6000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9E8378EB1C1D36B6000A5220 /* Build configuration list for PBXNativeTarget "TabBarUITests" */ = { isa = XCConfigurationList; @@ -498,6 +514,7 @@ 9E8378ED1C1D36B6000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Chapter7/Chapter7-1/TabBar/TabBar/AppDelegate.swift b/Chapter7/Chapter7-1/TabBar/TabBar/AppDelegate.swift index aeb566d..7dfeb2c 100644 --- a/Chapter7/Chapter7-1/TabBar/TabBar/AppDelegate.swift +++ b/Chapter7/Chapter7-1/TabBar/TabBar/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter7/Chapter7-1/TabBar/TabBar/Base.lproj/LaunchScreen.storyboard b/Chapter7/Chapter7-1/TabBar/TabBar/Base.lproj/LaunchScreen.storyboard index 977ea30..1d03c2d 100644 --- a/Chapter7/Chapter7-1/TabBar/TabBar/Base.lproj/LaunchScreen.storyboard +++ b/Chapter7/Chapter7-1/TabBar/TabBar/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + diff --git a/Chapter7/Chapter7-1/TabBar/TabBar/Base.lproj/Main.storyboard b/Chapter7/Chapter7-1/TabBar/TabBar/Base.lproj/Main.storyboard index 94882f5..a184cec 100644 --- a/Chapter7/Chapter7-1/TabBar/TabBar/Base.lproj/Main.storyboard +++ b/Chapter7/Chapter7-1/TabBar/TabBar/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -14,9 +18,9 @@ - + - + @@ -33,9 +37,9 @@ - + - + @@ -50,7 +54,7 @@ - + diff --git a/Chapter7/Chapter7-1/TabBar/TabBarTests/TabBarTests.swift b/Chapter7/Chapter7-1/TabBar/TabBarTests/TabBarTests.swift index 205e7c0..49f05f3 100644 --- a/Chapter7/Chapter7-1/TabBar/TabBarTests/TabBarTests.swift +++ b/Chapter7/Chapter7-1/TabBar/TabBarTests/TabBarTests.swift @@ -28,7 +28,7 @@ class TabBarTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter7/Chapter7-2/VeseKentei/VeseKentei.xcodeproj/project.pbxproj b/Chapter7/Chapter7-2/VeseKentei/VeseKentei.xcodeproj/project.pbxproj index c480017..d7c4aec 100644 --- a/Chapter7/Chapter7-2/VeseKentei/VeseKentei.xcodeproj/project.pbxproj +++ b/Chapter7/Chapter7-2/VeseKentei/VeseKentei.xcodeproj/project.pbxproj @@ -368,18 +368,21 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9E8378F61C1D49D3000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; }; 9E83790A1C1D49D4000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; TestTargetID = 9E8378F61C1D49D3000A5220; }; 9E8379151C1D49D4000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; TestTargetID = 9E8378F61C1D49D3000A5220; }; }; @@ -557,8 +560,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -601,8 +606,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; @@ -621,6 +628,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -633,6 +641,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.VeseKentei; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -644,6 +653,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.VeseKentei; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -655,6 +665,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.VeseKenteiTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VeseKentei.app/VeseKentei"; }; name = Debug; @@ -667,6 +678,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.VeseKenteiTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VeseKentei.app/VeseKentei"; }; name = Release; @@ -678,6 +690,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.VeseKenteiUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = VeseKentei; USES_XCTRUNNER = YES; }; @@ -690,6 +703,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.VeseKenteiUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = VeseKentei; USES_XCTRUNNER = YES; }; @@ -714,6 +728,7 @@ 9E8379211C1D49D4000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9E8379221C1D49D4000A5220 /* Build configuration list for PBXNativeTarget "VeseKenteiTests" */ = { isa = XCConfigurationList; @@ -722,6 +737,7 @@ 9E8379241C1D49D4000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; 9E8379251C1D49D4000A5220 /* Build configuration list for PBXNativeTarget "VeseKenteiUITests" */ = { isa = XCConfigurationList; @@ -730,6 +746,7 @@ 9E8379271C1D49D4000A5220 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/AppDelegate.swift b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/AppDelegate.swift index 06c4614..50043a2 100644 --- a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/AppDelegate.swift +++ b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Assets.xcassets/AppIcon.appiconset/Contents.json b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f..b8236c6 100644 --- a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", diff --git a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Base.lproj/LaunchScreen.storyboard b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Base.lproj/LaunchScreen.storyboard index 2e721e1..1d03c2d 100644 --- a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Base.lproj/LaunchScreen.storyboard +++ b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,12 @@ - + + + + - + + + @@ -13,10 +18,9 @@ - + - - + diff --git a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Base.lproj/Main.storyboard b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Base.lproj/Main.storyboard index 38c3859..9c50bc6 100644 --- a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Base.lproj/Main.storyboard +++ b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -31,7 +35,7 @@ - + - + - + @@ -69,7 +73,7 @@ - + @@ -89,7 +93,6 @@ - @@ -127,12 +130,12 @@ - + - + @@ -148,7 +151,7 @@ - + @@ -162,7 +165,7 @@ - + @@ -176,7 +179,7 @@ - + @@ -190,7 +193,7 @@ - + @@ -205,7 +208,7 @@ - + @@ -225,7 +228,6 @@ - @@ -239,7 +241,7 @@ - + @@ -269,7 +271,7 @@ - + - + @@ -295,7 +297,6 @@ - @@ -303,13 +304,13 @@ - + - - + + diff --git a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/KenteiViewController.swift b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/KenteiViewController.swift index f213300..136587e 100644 --- a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/KenteiViewController.swift +++ b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/KenteiViewController.swift @@ -40,40 +40,40 @@ class KenteiViewController: UIViewController { //バックグラウンド画像をセット kaisetsuBGImageView.image = UIImage(named: "kaisetsuBG.png") //画面サイズを取得 - let screenSize:CGSize = UIScreen.mainScreen().bounds.size + let screenSize:CGSize = UIScreen.main.bounds.size //解説バッググラウンド画像のX座標(画面の中央になるなうように設定) kaisetsuBGX = Double(screenSize.width/2) - 320/2 //解説画像の位置を設定。Y座標に画面の縦サイズを設定して、画面の外に設置 kaisetsuBGImageView.frame = CGRect(x:kaisetsuBGX, y: Double(screenSize.height), width: 320, height: 210) //画像上のタッチ操作を可能にする - kaisetsuBGImageView.userInteractionEnabled = true + kaisetsuBGImageView.isUserInteractionEnabled = true //画像をviewに配置 self.view.addSubview(kaisetsuBGImageView) //正解表示ラベルのフレームを設定 seikaiLabel.frame = CGRect(x: 10, y: 5, width: 300, height: 30) //正解表示ラベルのアラインメントをセンターに設定 - seikaiLabel.textAlignment = .Center + seikaiLabel.textAlignment = .center //正解表示ラベルのフォントサイズを15ポイント設定 - seikaiLabel.font = UIFont.systemFontOfSize(15) + seikaiLabel.font = UIFont.systemFont(ofSize: 15) //正解ラベルを解説バックグラウンド画像に配置 kaisetsuBGImageView.addSubview(seikaiLabel) //解説テキストビューのフレームを設定 kaisetsuTextView.frame = CGRect(x: 10, y: 40, width: 300, height: 140) //解説テキストビューの背景色を透明に設定 - kaisetsuTextView.backgroundColor = UIColor.clearColor() + kaisetsuTextView.backgroundColor = UIColor.clear //解説テキストビューのフォントサイズを17ポイントに設定 - kaisetsuTextView.font = UIFont.systemFontOfSize(17) + kaisetsuTextView.font = UIFont.systemFont(ofSize: 17) //解説テキストビューの編集を不可に設定 - kaisetsuTextView.editable = false + kaisetsuTextView.isEditable = false //解説テキストビューを解説バックグラウンド画像に配置 kaisetsuBGImageView.addSubview(kaisetsuTextView) //バックボタンのフレームを設定 backBtn.frame = CGRect(x: 10, y: 180, width: 300, height: 30) //バックボタンに通常時と押下時の画像を設定 - backBtn.setImage(UIImage(named: "kenteiBack.png"), forState: .Normal) - backBtn.setImage(UIImage(named: "kenteiBackOn.png"),forState: .Highlighted) + backBtn.setImage(UIImage(named: "kenteiBack.png"), for: .normal) + backBtn.setImage(UIImage(named: "kenteiBackOn.png"),for: .highlighted) //バックボタンにアクション設定 - backBtn.addTarget(self, action: "backBtnTapped", forControlEvents: UIControlEvents.TouchUpInside) + backBtn.addTarget(self, action: #selector(KenteiViewController.backBtnTapped), for: UIControlEvents.touchUpInside) //バックボタンを解説バックグラウンド画像に配置 kaisetsuBGImageView.addSubview(backBtn) //変数viewControllerを作成 @@ -81,54 +81,54 @@ class KenteiViewController: UIViewController { //loadCSVメソッドを使用し、csvArrayに検定問題を格納 csvArray = viewController.loadCSV("kentei") //csvArrayの0行目を取り出し、カンマを区切りとしてmondaiArrayに格納 - mondaiArray = csvArray[mondaiCount].componentsSeparatedByString(",") + mondaiArray = csvArray[mondaiCount].components(separatedBy: ",") //変数mondaiCountに1を足して、ラベルに出題数を設定 mondaiNumberLabel.text = "第\(mondaiCount+1)問" //TextViewに問題を設定 mondaiTextView.text = mondaiArray[0] //選択肢ボタンのタイトルに選択肢を設定 - answerBtn1.setTitle(mondaiArray[2], forState: .Normal) - answerBtn2.setTitle(mondaiArray[3], forState: .Normal) - answerBtn3.setTitle(mondaiArray[4], forState: .Normal) - answerBtn4.setTitle(mondaiArray[5], forState: .Normal) + answerBtn1.setTitle(mondaiArray[2], for: .normal) + answerBtn2.setTitle(mondaiArray[3], for: .normal) + answerBtn3.setTitle(mondaiArray[4], for: .normal) + answerBtn4.setTitle(mondaiArray[5], for: .normal) } //四択ボタンを押したときのメソッド - @IBAction func btnAction(sender: UIButton){ + @IBAction func btnAction(_ sender: UIButton){ //正解番号(Int型にキャスト)ボタンのtagが同じなら正解 if sender.tag == Int(mondaiArray[1]){ //○を表示 judgeImageView.image = UIImage(named: "maru.png") //正解カウントを増やす - correctCount++ + correctCount += 1 }else{ //間違っていたら×を表示 judgeImageView.image = UIImage(named: "batsu.png") } //judgeImageViewを表示 - judgeImageView.hidden = false + judgeImageView.isHidden = false //解説を呼び出すメソッド kaisetsu() } //次の問題を表示するメソッド func nextProblem(){ //問題カウント変数をカウントアップ - mondaiCount++ + mondaiCount += 1 //mondaiArrayに格納されている問題配列を削除 mondaiArray.removeAll() //if-else文を追加。mondaiCountがtotalに達したら画面遷移 if mondaiCount < total{ //csvArrayから次の問題配列をmondaiArrayに格納 - mondaiArray = csvArray[mondaiCount].componentsSeparatedByString(",") + mondaiArray = csvArray[mondaiCount].components(separatedBy: ",") //問題数ラベル、問題表示TextView、選択肢ボタンに文字をセット mondaiNumberLabel.text = "第\(mondaiCount+1)問" mondaiTextView.text = mondaiArray[0] - answerBtn1.setTitle(mondaiArray[2], forState: .Normal) - answerBtn2.setTitle(mondaiArray[3], forState: .Normal) - answerBtn3.setTitle(mondaiArray[4], forState: .Normal) - answerBtn4.setTitle(mondaiArray[5], forState: .Normal) + answerBtn1.setTitle(mondaiArray[2], for: .normal) + answerBtn2.setTitle(mondaiArray[3], for: .normal) + answerBtn3.setTitle(mondaiArray[4], for: .normal) + answerBtn4.setTitle(mondaiArray[5], for: .normal) }else{ //Stroyboard SegueのIdentifierを引数に設定して画面遷移 - performSegueWithIdentifier("score", sender: nil) + performSegue(withIdentifier: "score", sender: nil) } } //解説表示メソッド @@ -140,34 +140,34 @@ class KenteiViewController: UIViewController { //answerBtn1のy座標を取得 let answerBtnY = answerBtn1.frame.origin.y //解説バックグラウンド画像を表示させるアニメーション - UIView.animateWithDuration(0.5, animations: {() -> Void in self.kaisetsuBGImageView.frame = CGRect(x: self.kaisetsuBGX, y: Double(answerBtnY), width: 320, height: 210) + UIView.animate(withDuration: 0.5, animations: {() -> Void in self.kaisetsuBGImageView.frame = CGRect(x: self.kaisetsuBGX, y: Double(answerBtnY), width: 320, height: 210) }) //選択肢ボタンの使用停止 - answerBtn1.enabled = false - answerBtn2.enabled = false - answerBtn3.enabled = false - answerBtn4.enabled = false + answerBtn1.isEnabled = false + answerBtn2.isEnabled = false + answerBtn3.isEnabled = false + answerBtn4.isEnabled = false } //バックボタンメソッド func backBtnTapped(){ //画面の縦サイズを取得 - let screenHeight = Double(UIScreen.mainScreen().bounds.size.height) + let screenHeight = Double(UIScreen.main.bounds.size.height) //解説バックグラウンド画像を枠外に移動させるアニメーション - UIView.animateWithDuration(0.5, animations: {() -> Void in self.kaisetsuBGImageView.frame = CGRect(x: self.kaisetsuBGX, y: screenHeight, width: 320, height: 210) + UIView.animate(withDuration: 0.5, animations: {() -> Void in self.kaisetsuBGImageView.frame = CGRect(x: self.kaisetsuBGX, y: screenHeight, width: 320, height: 210) }) //選択肢ボタンの使用を再開 - answerBtn1.enabled = true - answerBtn2.enabled = true - answerBtn3.enabled = true - answerBtn4.enabled = true + answerBtn1.isEnabled = true + answerBtn2.isEnabled = true + answerBtn3.isEnabled = true + answerBtn4.isEnabled = true //正誤表示画像を隠す - judgeImageView.hidden = true + judgeImageView.isHidden = true //nextProblemメソッドを呼び出す nextProblem() } //得点画面へ値を渡す - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { - let sVC = segue.destinationViewController as! ScoreViewController + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + let sVC = segue.destination as! ScoreViewController sVC.correct = correctCount } diff --git a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/ViewController.swift b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/ViewController.swift index 80fe09a..a744f11 100644 --- a/Chapter7/Chapter7-2/VeseKentei/VeseKentei/ViewController.swift +++ b/Chapter7/Chapter7-2/VeseKentei/VeseKentei/ViewController.swift @@ -27,23 +27,23 @@ class ViewController: UIViewController { //bodyTextViewにアプリ説明文を設定 bodyTextView.text = csvArray[2] //ボタンの文字を白色に変更 - startButton.setTitleColor(UIColor.whiteColor(), forState: UIControlState.Normal) + startButton.setTitleColor(UIColor.white, for: .normal) //creditLabelにクレジットを設定 creditLabel.text = csvArray[3] } //CSVファイル読み込みメソッド。引数でファイル名を取得。戻り値はString型の配列。 - func loadCSV(fileName :String) -> [String]{ + func loadCSV(_ fileName :String) -> [String]{ //CSVファイルのデータを格納するStrig型配列 var csvArray:[String] = [] //引数filnameからCSVファイルのパスを設定 - let csvBundle = NSBundle.mainBundle().pathForResource(fileName, ofType: "csv")! + let csvBundle = Bundle.main.path(forResource: fileName, ofType: "csv")! do { //csvBundleからファイルを読み込み、エンコーディングしてcsvDataに格納 - let csvData = try String(contentsOfFile: csvBundle,encoding: NSUTF8StringEncoding) + let csvData = try String(contentsOfFile: csvBundle,encoding: String.Encoding.utf8) //改行コードが"\r"の場合は"\n"に置換する - let lineChange = csvData.stringByReplacingOccurrencesOfString("\r", withString: "\n") + let lineChange = csvData.replacingOccurrences(of: "\r", with: "\n") //"\n"の改行コードで要素を切り分け、配列csvArrayに格納する - csvArray = lineChange.componentsSeparatedByString("\n") + csvArray = lineChange.components(separatedBy: "\n") }catch{ print("エラー") } diff --git a/Chapter7/Chapter7-2/VeseKentei/VeseKenteiTests/VeseKenteiTests.swift b/Chapter7/Chapter7-2/VeseKentei/VeseKenteiTests/VeseKenteiTests.swift index 8d01a65..0d80513 100644 --- a/Chapter7/Chapter7-2/VeseKentei/VeseKenteiTests/VeseKenteiTests.swift +++ b/Chapter7/Chapter7-2/VeseKentei/VeseKenteiTests/VeseKenteiTests.swift @@ -28,7 +28,7 @@ class VeseKenteiTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter7/Chapter7-3/VeseKentei/VeseKentei.xcodeproj/project.pbxproj b/Chapter7/Chapter7-3/VeseKentei/VeseKentei.xcodeproj/project.pbxproj index ef94c13..bdfe960 100644 --- a/Chapter7/Chapter7-3/VeseKentei/VeseKentei.xcodeproj/project.pbxproj +++ b/Chapter7/Chapter7-3/VeseKentei/VeseKentei.xcodeproj/project.pbxproj @@ -377,19 +377,22 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Haruyoshi Kuwamura"; TargetAttributes = { 9E8378F61C1D49D3000A5220 = { CreatedOnToolsVersion = 7.2; DevelopmentTeam = 8P78442AH9; + LastSwiftMigration = 0820; }; 9E83790A1C1D49D4000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; TestTargetID = 9E8378F61C1D49D3000A5220; }; 9E8379151C1D49D4000A5220 = { CreatedOnToolsVersion = 7.2; + LastSwiftMigration = 0820; TestTargetID = 9E8378F61C1D49D3000A5220; }; }; @@ -570,8 +573,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution: onTheHammock LLC (8P78442AH9)"; @@ -615,8 +620,10 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution: onTheHammock LLC (8P78442AH9)"; @@ -636,6 +643,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 9.2; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; VALIDATE_PRODUCT = YES; }; name = Release; @@ -643,32 +651,34 @@ 9E8379201C1D49D4000A5220 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Distribution: onTheHammock LLC (8P78442AH9)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; INFOPLIST_FILE = VeseKentei/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onTheHammock.VeseKentei; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; + SWIFT_VERSION = 3.0; }; name = Debug; }; 9E8379211C1D49D4000A5220 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Distribution: onTheHammock LLC (8P78442AH9)"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - EMBEDDED_CONTENT_CONTAINS_SWIFT = YES; INFOPLIST_FILE = VeseKentei/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 9.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.onTheHammock.VeseKentei; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; + SWIFT_VERSION = 3.0; }; name = Release; }; @@ -680,6 +690,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.VeseKenteiTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VeseKentei.app/VeseKentei"; }; name = Debug; @@ -692,6 +703,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.VeseKenteiTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VeseKentei.app/VeseKentei"; }; name = Release; @@ -703,6 +715,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.VeseKenteiUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = VeseKentei; USES_XCTRUNNER = YES; }; @@ -715,6 +728,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = onTheHammock.VeseKenteiUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; TEST_TARGET_NAME = VeseKentei; USES_XCTRUNNER = YES; }; diff --git a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/AppDelegate.swift b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/AppDelegate.swift index 06c4614..50043a2 100644 --- a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/AppDelegate.swift +++ b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/AppDelegate.swift @@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. return true } - func applicationWillResignActive(application: UIApplication) { + func applicationWillResignActive(_ application: UIApplication) { // 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. // 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. } - func applicationDidEnterBackground(application: UIApplication) { + func applicationDidEnterBackground(_ application: UIApplication) { // 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. // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. } - func applicationWillEnterForeground(application: UIApplication) { + func applicationWillEnterForeground(_ application: UIApplication) { // 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. } - func applicationDidBecomeActive(application: UIApplication) { + func applicationDidBecomeActive(_ application: UIApplication) { // 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. } - func applicationWillTerminate(application: UIApplication) { + func applicationWillTerminate(_ application: UIApplication) { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. } diff --git a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/Base.lproj/Main.storyboard b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/Base.lproj/Main.storyboard index 9a91218..b08543a 100644 --- a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/Base.lproj/Main.storyboard +++ b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/Base.lproj/Main.storyboard @@ -1,8 +1,12 @@ - + + + + - + + @@ -31,7 +35,7 @@ - + - + @@ -69,7 +73,7 @@ - + @@ -89,7 +93,6 @@ - @@ -127,12 +130,12 @@ - + - + @@ -148,7 +151,7 @@ - + @@ -162,7 +165,7 @@ - + @@ -176,7 +179,7 @@ - + @@ -190,7 +193,7 @@ - + @@ -205,7 +208,7 @@ - + @@ -225,7 +228,6 @@ - @@ -239,7 +241,7 @@ - + @@ -269,7 +271,7 @@ - + - + @@ -339,7 +341,6 @@ - @@ -349,15 +350,15 @@ - + - - + + - + diff --git a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/KenteiViewController.swift b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/KenteiViewController.swift index 4e4508c..94532b5 100644 --- a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/KenteiViewController.swift +++ b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/KenteiViewController.swift @@ -42,40 +42,40 @@ class KenteiViewController: UIViewController { //バックグラウンド画像をセット kaisetsuBGImageView.image = UIImage(named: "kaisetsuBG.png") //画面サイズを取得 - let screenSize:CGSize = UIScreen.mainScreen().bounds.size + let screenSize:CGSize = UIScreen.main.bounds.size //解説バッググラウンド画像のX座標(画面の中央になるなうように設定) kaisetsuBGX = Double(screenSize.width/2) - 320/2 //解説画像の位置を設定。Y座標に画面の縦サイズを設定して、画面の外に設置 kaisetsuBGImageView.frame = CGRect(x:kaisetsuBGX, y: Double(screenSize.height), width: 320, height: 210) //画像上のタッチ操作を可能にする - kaisetsuBGImageView.userInteractionEnabled = true + kaisetsuBGImageView.isUserInteractionEnabled = true //画像をviewに配置 self.view.addSubview(kaisetsuBGImageView) //正解表示ラベルのフレームを設定 seikaiLabel.frame = CGRect(x: 10, y: 5, width: 300, height: 30) //正解表示ラベルのアラインメントをセンターに設定 - seikaiLabel.textAlignment = .Center + seikaiLabel.textAlignment = .center //正解表示ラベルのフォントサイズを15ポイント設定 - seikaiLabel.font = UIFont.systemFontOfSize(15) + seikaiLabel.font = UIFont.systemFont(ofSize: 15) //正解ラベルを解説バックグラウンド画像に配置 kaisetsuBGImageView.addSubview(seikaiLabel) //解説テキストビューのフレームを設定 kaisetsuTextView.frame = CGRect(x: 10, y: 40, width: 300, height: 140) //解説テキストビューの背景色を透明に設定 - kaisetsuTextView.backgroundColor = UIColor.clearColor() + kaisetsuTextView.backgroundColor = UIColor.clear //解説テキストビューのフォントサイズを17ポイントに設定 - kaisetsuTextView.font = UIFont.systemFontOfSize(17) + kaisetsuTextView.font = UIFont.systemFont(ofSize: 17) //解説テキストビューの編集を不可に設定 - kaisetsuTextView.editable = false + kaisetsuTextView.isEditable = false //解説テキストビューを解説バックグラウンド画像に配置 kaisetsuBGImageView.addSubview(kaisetsuTextView) //バックボタンのフレームを設定 backBtn.frame = CGRect(x: 10, y: 180, width: 300, height: 30) //バックボタンに通常時と押下時の画像を設定 - backBtn.setImage(UIImage(named: "kenteiBack.png"), forState: .Normal) - backBtn.setImage(UIImage(named: "kenteiBackOn.png"),forState: .Highlighted) + backBtn.setImage(UIImage(named: "kenteiBack.png"), for: .normal) + backBtn.setImage(UIImage(named: "kenteiBackOn.png"),for: .highlighted) //バックボタンにアクション設定 - backBtn.addTarget(self, action: "backBtnTapped", forControlEvents: UIControlEvents.TouchUpInside) + backBtn.addTarget(self, action: #selector(KenteiViewController.backBtnTapped), for: UIControlEvents.touchUpInside) //バックボタンを解説バックグラウンド画像に配置 kaisetsuBGImageView.addSubview(backBtn) //変数viewControllerを作成 @@ -85,19 +85,19 @@ class KenteiViewController: UIViewController { //シャッフルメソッドを使用し、検定問題を並び替えてcsvArrayに格納 csvArray = mondaiShuffle() //csvArrayの0行目を取り出し、カンマを区切りとしてmondaiArrayに格納 - mondaiArray = csvArray[mondaiCount].componentsSeparatedByString(",") + mondaiArray = csvArray[mondaiCount].components(separatedBy: ",") //変数mondaiCountに1を足して、ラベルに出題数を設定 mondaiNumberLabel.text = "第\(mondaiCount+1)問" //TextViewに問題を設定 mondaiTextView.text = mondaiArray[0] //選択肢ボタンのタイトルに選択肢を設定 - answerBtn1.setTitle(mondaiArray[2], forState: .Normal) - answerBtn2.setTitle(mondaiArray[3], forState: .Normal) - answerBtn3.setTitle(mondaiArray[4], forState: .Normal) - answerBtn4.setTitle(mondaiArray[5], forState: .Normal) + answerBtn1.setTitle(mondaiArray[2], for: .normal) + answerBtn2.setTitle(mondaiArray[3], for: .normal) + answerBtn3.setTitle(mondaiArray[4], for: .normal) + answerBtn4.setTitle(mondaiArray[5], for: .normal) } //四択ボタンを押したときのメソッド - @IBAction func btnAction(sender: UIButton){ + @IBAction func btnAction(_ sender: UIButton){ //正解番号(Int型にキャスト)ボタンのtagが同じなら正解 if sender.tag == Int(mondaiArray[1]){ //○を表示 @@ -105,7 +105,7 @@ class KenteiViewController: UIViewController { //SEManagerクラスのsePlayメソッドで正解音を鳴らす soundManager.sePlay("right.mp3") //正解カウントを増やす - correctCount++ + correctCount += 1 }else{ //間違っていたら×を表示 judgeImageView.image = UIImage(named: "batsu.png") @@ -113,30 +113,30 @@ class KenteiViewController: UIViewController { soundManager.sePlay("mistake.mp3") } //judgeImageViewを表示 - judgeImageView.hidden = false + judgeImageView.isHidden = false //解説を呼び出すメソッド kaisetsu() } //次の問題を表示するメソッド func nextProblem(){ //問題カウント変数をカウントアップ - mondaiCount++ + mondaiCount += 1 //mondaiArrayに格納されている問題配列を削除 mondaiArray.removeAll() //if-else文を追加。mondaiCountがtotalに達したら画面遷移 if mondaiCount < total{ //csvArrayから次の問題配列をmondaiArrayに格納 - mondaiArray = csvArray[mondaiCount].componentsSeparatedByString(",") + mondaiArray = csvArray[mondaiCount].components(separatedBy: ",") //問題数ラベル、問題表示TextView、選択肢ボタンに文字をセット mondaiNumberLabel.text = "第\(mondaiCount+1)問" mondaiTextView.text = mondaiArray[0] - answerBtn1.setTitle(mondaiArray[2], forState: .Normal) - answerBtn2.setTitle(mondaiArray[3], forState: .Normal) - answerBtn3.setTitle(mondaiArray[4], forState: .Normal) - answerBtn4.setTitle(mondaiArray[5], forState: .Normal) + answerBtn1.setTitle(mondaiArray[2], for: .normal) + answerBtn2.setTitle(mondaiArray[3], for: .normal) + answerBtn3.setTitle(mondaiArray[4], for: .normal) + answerBtn4.setTitle(mondaiArray[5], for: .normal) }else{ //Stroyboard SegueのIdentifierを引数に設定して画面遷移 - performSegueWithIdentifier("score", sender: nil) + performSegue(withIdentifier: "score", sender: nil) } } //解説表示メソッド @@ -148,34 +148,34 @@ class KenteiViewController: UIViewController { //answerBtn1のy座標を取得 let answerBtnY = answerBtn1.frame.origin.y //解説バックグラウンド画像を表示させるアニメーション - UIView.animateWithDuration(0.5, animations: {() -> Void in self.kaisetsuBGImageView.frame = CGRect(x: self.kaisetsuBGX, y: Double(answerBtnY), width: 320, height: 210) + UIView.animate(withDuration: 0.5, animations: {() -> Void in self.kaisetsuBGImageView.frame = CGRect(x: self.kaisetsuBGX, y: Double(answerBtnY), width: 320, height: 210) }) //選択肢ボタンの使用停止 - answerBtn1.enabled = false - answerBtn2.enabled = false - answerBtn3.enabled = false - answerBtn4.enabled = false + answerBtn1.isEnabled = false + answerBtn2.isEnabled = false + answerBtn3.isEnabled = false + answerBtn4.isEnabled = false } //バックボタンメソッド func backBtnTapped(){ //画面の縦サイズを取得 - let screenHeight = Double(UIScreen.mainScreen().bounds.size.height) + let screenHeight = Double(UIScreen.main.bounds.size.height) //解説バックグラウンド画像を枠外に移動させるアニメーション - UIView.animateWithDuration(0.5, animations: {() -> Void in self.kaisetsuBGImageView.frame = CGRect(x: self.kaisetsuBGX, y: screenHeight, width: 320, height: 210) + UIView.animate(withDuration: 0.5, animations: {() -> Void in self.kaisetsuBGImageView.frame = CGRect(x: self.kaisetsuBGX, y: screenHeight, width: 320, height: 210) }) //選択肢ボタンの使用を再開 - answerBtn1.enabled = true - answerBtn2.enabled = true - answerBtn3.enabled = true - answerBtn4.enabled = true + answerBtn1.isEnabled = true + answerBtn2.isEnabled = true + answerBtn3.isEnabled = true + answerBtn4.isEnabled = true //正誤表示画像を隠す - judgeImageView.hidden = true + judgeImageView.isHidden = true //nextProblemメソッドを呼び出す nextProblem() } //得点画面へ値を渡す - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { - let sVC = segue.destinationViewController as! ScoreViewController + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + let sVC = segue.destination as! ScoreViewController sVC.correct = correctCount } //配列シャッフルメソッド @@ -190,7 +190,7 @@ class KenteiViewController: UIViewController { //ランダムなインデックス番号を取得するため配列数の範囲で乱数を作る let randomIndex = arc4random() % UInt32(arrayCount) //sortedArrayのarrayCount番号とランダム番号を入れ替える - sortedArray.exchangeObjectAtIndex((arrayCount-1),withObjectAtIndex: Int(randomIndex)) + sortedArray.exchangeObject(at: (arrayCount-1),withObjectAt: Int(randomIndex)) //arrayCountを1減らす arrayCount = arrayCount-1 //sortedArrayのarrayCount番号の要素をarrayに追加 diff --git a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/SEManager.swift b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/SEManager.swift index 270237c..0c8b799 100644 --- a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/SEManager.swift +++ b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/SEManager.swift @@ -14,12 +14,12 @@ class SEManager: NSObject, AVAudioPlayerDelegate { var soundArray = [AVAudioPlayer]() //音を再生するsePlayメソッド - func sePlay(soundName: String) { - let path = NSBundle.mainBundle().bundleURL.URLByAppendingPathComponent(soundName) + func sePlay(_ soundName: String) { + let path = Bundle.main.bundleURL.appendingPathComponent(soundName) var player: AVAudioPlayer! do { - try player = AVAudioPlayer(contentsOfURL: path) + try player = AVAudioPlayer(contentsOf: path) //配列soundArrayにplayerを追加 soundArray.append(player) player.delegate = self @@ -31,11 +31,11 @@ class SEManager: NSObject, AVAudioPlayerDelegate { } } //サウンドの再生後に実行されるメソッド - func audioPlayerDidFinishPlaying(player: AVAudioPlayer, successfully flag: Bool) { + func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) { //再生が終わった変数のインデックスを調べる - let i: Int = soundArray.indexOf(player)! + let i: Int = soundArray.index(of: player)! //上記で調べたインデックスの要素を削除する。 - soundArray.removeAtIndex(i) + soundArray.remove(at: i) } -} \ No newline at end of file +} diff --git a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/ScoreViewController.swift b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/ScoreViewController.swift index 6046f2e..a132cd0 100644 --- a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/ScoreViewController.swift +++ b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/ScoreViewController.swift @@ -26,17 +26,17 @@ class ScoreViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() //合格回数を保存するNSUserDefaults - let goukakuUd = NSUserDefaults.standardUserDefaults() + let goukakuUd = UserDefaults.standard //合格回数をgoukakuというキー値で変数goukakuTimesに格納 - goukakuTimes = goukakuUd.integerForKey("goukaku") + goukakuTimes = goukakuUd.integer(forKey: "goukaku") //正解数を表示 scoreLabel.text = "正解数は\(correct)問です。" //合格・不合格を判定 if correct >= 7{ judgeImageView.image = UIImage(named: "Goukaku.png") - goukakuTimes++ //合格回数をカウントアップ + goukakuTimes += 1 //合格回数をカウントアップ //goukakuキー値を使って合格回数(goukakuTimes)を保存 - goukakuUd.setInteger(goukakuTimes, forKey: "goukaku") + goukakuUd.set(goukakuTimes, forKey: "goukaku") }else{ judgeImageView.image = UIImage(named: "Fugoukaku.png") } @@ -60,30 +60,30 @@ class ScoreViewController: UIViewController { rankLabel.text = "ランクは\(rankString)!" } //Facebook投稿メソッド - @IBAction func postFacebook(sender: AnyObject) { + @IBAction func postFacebook(_ sender: AnyObject) { //Facebook投稿用インスタンスを作成 let fbVC:SLComposeViewController = SLComposeViewController (forServiceType: SLServiceTypeFacebook)! //投稿テキストを設定 fbVC.setInitialText("三浦のおやさい検定:私は\(rankString)。合格回数は\(goukakuTimes)回です。") //投稿画像を設定 - fbVC.addImage(UIImage(named: "icon.png")) + fbVC.add(UIImage(named: "icon.png")) //投稿用URLを設定 - fbVC.addURL(NSURL(string: "http://onthehammock.com/app/5783")) + fbVC.add(URL(string: "http://onthehammock.com/app/5783")) //投稿コントローラーを起動 - self.presentViewController(fbVC, animated: true, completion: nil) + self.present(fbVC, animated: true, completion: nil) } //Twitter投稿メソッド - @IBAction func postTwitter(sender: AnyObject) { + @IBAction func postTwitter(_ sender: AnyObject) { //Twitter投稿用インスタンスを作成 let twVC:SLComposeViewController = SLComposeViewController (forServiceType: SLServiceTypeTwitter)! //投稿テキストを設定 twVC.setInitialText("三浦のおやさい検定:私は\(rankString)。合格回数は\(goukakuTimes)回です。") //投稿画像を設定 - twVC.addImage(UIImage(named: "icon.png")) + twVC.add(UIImage(named: "icon.png")) //投稿用URLを設定 - twVC.addURL(NSURL(string: "http://onthehammock.com/app/5783")) + twVC.add(URL(string: "http://onthehammock.com/app/5783")) //投稿コントローラーを起動 - self.presentViewController(twVC, animated: true, completion: nil) + self.present(twVC, animated: true, completion: nil) } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() diff --git a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/ViewController.swift b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/ViewController.swift index 996a8cb..f79a9e0 100644 --- a/Chapter7/Chapter7-3/VeseKentei/VeseKentei/ViewController.swift +++ b/Chapter7/Chapter7-3/VeseKentei/VeseKentei/ViewController.swift @@ -27,23 +27,23 @@ class ViewController: UIViewController { //bodyTextViewにアプリ説明文を設定 bodyTextView.text = csvArray[2] //ボタンの文字を白色に変更 - startButton.setTitleColor(UIColor.whiteColor(), forState: UIControlState.Normal) + startButton.setTitleColor(UIColor.white, for: .normal) //creditLabelにクレジットを設定 creditLabel.text = csvArray[3] } //CSVファイル読み込みメソッド。引数でファイル名を取得。戻り値はString型の配列。 - func loadCSV(fileName :String) -> [String]{ + func loadCSV(_ fileName :String) -> [String]{ //CSVファイルのデータを格納するStrig型配列 var csvArray:[String] = [] //引数filnameからCSVファイルのパスを設定 - let csvBundle = NSBundle.mainBundle().pathForResource(fileName, ofType: "csv")! + let csvBundle = Bundle.main.path(forResource: fileName, ofType: "csv")! do { //csvBundleからファイルを読み込み、エンコーディングしてcsvDataに格納 - let csvData = try String(contentsOfFile: csvBundle,encoding: NSUTF8StringEncoding) + let csvData = try String(contentsOfFile: csvBundle,encoding: String.Encoding.utf8) //改行コードが"\r"の場合は"\n"に置換する - let lineChange = csvData.stringByReplacingOccurrencesOfString("\r", withString: "\n") + let lineChange = csvData.replacingOccurrences(of: "\r", with: "\n") //"\n"の改行コードで要素を切り分け、配列csvArrayに格納する - csvArray = lineChange.componentsSeparatedByString("\n") + csvArray = lineChange.components(separatedBy: "\n") }catch{ print("エラー") } @@ -53,4 +53,4 @@ class ViewController: UIViewController { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } -} \ No newline at end of file +} diff --git a/Chapter7/Chapter7-3/VeseKentei/VeseKenteiTests/VeseKenteiTests.swift b/Chapter7/Chapter7-3/VeseKentei/VeseKenteiTests/VeseKenteiTests.swift index 8d01a65..0d80513 100644 --- a/Chapter7/Chapter7-3/VeseKentei/VeseKenteiTests/VeseKenteiTests.swift +++ b/Chapter7/Chapter7-3/VeseKentei/VeseKenteiTests/VeseKenteiTests.swift @@ -28,7 +28,7 @@ class VeseKenteiTests: XCTestCase { func testPerformanceExample() { // This is an example of a performance test case. - self.measureBlock { + self.measure { // Put the code you want to measure the time of here. } } diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.gitignore b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.gitignore old mode 100644 new mode 100755 index ee2640c..222e8ec --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.gitignore +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.gitignore @@ -2,7 +2,12 @@ .DS_Store # Xcode + +## Build generated build/ +DerivedData + +## Various settings *.pbxuser !default.pbxuser *.mode1v3 @@ -12,12 +17,23 @@ build/ *.perspectivev3 !default.perspectivev3 xcuserdata + +## Other *.xccheckout *.moved-aside -DerivedData +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific *.hmap *.ipa -*.xcuserstate + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +.build/ # Carthage Carthage/Build diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.swift-version b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.swift-version new file mode 100755 index 0000000..9f55b2c --- /dev/null +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.swift-version @@ -0,0 +1 @@ +3.0 diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.travis.yml b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.travis.yml old mode 100644 new mode 100755 index 7b9db16..a79a308 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.travis.yml +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/.travis.yml @@ -1,32 +1,33 @@ language: objective-c -osx_image: xcode7.1 +osx_image: xcode8 env: global: - LC_CTYPE=en_US.UTF-8 - LANG=en_US.UTF-8 - WORKSPACE=Alamofire.xcworkspace - IOS_FRAMEWORK_SCHEME="Alamofire iOS" - - OSX_FRAMEWORK_SCHEME="Alamofire OSX" + - MACOS_FRAMEWORK_SCHEME="Alamofire macOS" - TVOS_FRAMEWORK_SCHEME="Alamofire tvOS" - WATCHOS_FRAMEWORK_SCHEME="Alamofire watchOS" - - IOS_SDK=iphonesimulator9.1 - - OSX_SDK=macosx10.11 - - TVOS_SDK=appletvsimulator9.0 - - WATCHOS_SDK=watchsimulator2.0 + - IOS_SDK=iphonesimulator10.0 + - MACOS_SDK=macosx10.12 + - TVOS_SDK=appletvsimulator10.0 + - WATCHOS_SDK=watchsimulator3.0 - EXAMPLE_SCHEME="iOS Example" matrix: - - DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES" - - DESTINATION="OS=8.2,name=iPhone 5" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=8.3,name=iPhone 5S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=8.4,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.0,name=iPhone 6 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="OS=9.1,name=iPhone 6S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" - - DESTINATION="arch=x86_64" SCHEME="$OSX_FRAMEWORK_SCHEME" SDK="$OSX_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" + - DESTINATION="OS=3.0,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" + - DESTINATION="OS=2.0,name=Apple Watch - 42mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" + + - DESTINATION="OS=10.0,name=iPhone 7 Plus" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="YES" + - DESTINATION="OS=9.0,name=iPhone 6" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" + - DESTINATION="OS=8.1,name=iPhone 4S" SCHEME="$IOS_FRAMEWORK_SCHEME" SDK="$IOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="YES" POD_LINT="NO" + + - DESTINATION="OS=10.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" - DESTINATION="OS=9.0,name=Apple TV 1080p" SCHEME="$TVOS_FRAMEWORK_SCHEME" SDK="$TVOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" - - DESTINATION="OS=2.0,name=Apple Watch - 38mm" SCHEME="$WATCHOS_FRAMEWORK_SCHEME" SDK="$WATCHOS_SDK" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" + + - DESTINATION="arch=x86_64" SCHEME="$MACOS_FRAMEWORK_SCHEME" SDK="$MACOS_SDK" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" before_install: - - gem install cocoapods --no-rdoc --no-ri --no-document --quiet - - gem install xcpretty --no-rdoc --no-ri --no-document --quiet + - gem install cocoapods --pre --no-rdoc --no-ri --no-document --quiet script: - set -o pipefail - xcodebuild -version @@ -34,26 +35,21 @@ script: # Build Framework in Debug and Run Tests if specified - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c; + xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty; else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; + xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty; fi # Build Framework in Release and Run Tests if specified - if [ $RUN_TESTS == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO test | xcpretty -c; + xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty; else - xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c; + xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty; fi # Build Example in Debug if specified - if [ $BUILD_EXAMPLE == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c; - fi - - # Build Example in Release if specified - - if [ $BUILD_EXAMPLE == "YES" ]; then - xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Release ONLY_ACTIVE_ARCH=NO build | xcpretty -c; + xcodebuild -workspace "$WORKSPACE" -scheme "$EXAMPLE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty; fi # Run `pod lib lint` if specified diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.podspec b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.podspec old mode 100644 new mode 100755 index 31713d9..22774c5 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.podspec +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Alamofire' - s.version = '3.1.3' + s.version = '4.2.0' s.license = 'MIT' s.summary = 'Elegant HTTP Networking in Swift' s.homepage = 'https://github.com/Alamofire/Alamofire' @@ -9,11 +9,9 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/Alamofire/Alamofire.git', :tag => s.version } s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' + s.osx.deployment_target = '10.10' s.tvos.deployment_target = '9.0' s.watchos.deployment_target = '2.0' s.source_files = 'Source/*.swift' - - s.requires_arc = true end diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/project.pbxproj b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/project.pbxproj old mode 100644 new mode 100755 index 3538a4d..864d82f --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/project.pbxproj +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/project.pbxproj @@ -6,7 +6,24 @@ objectVersion = 46; objects = { +/* Begin PBXAggregateTarget section */ + 4CCB207C1D45563900C64D5B /* Cleanup Whitespace */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 4CCB207F1D45563900C64D5B /* Build configuration list for PBXAggregateTarget "Cleanup Whitespace" */; + buildPhases = ( + 4CCB20801D45564D00C64D5B /* Cleanup Whitespace */, + ); + dependencies = ( + ); + name = "Cleanup Whitespace"; + productName = "Cleanup Whitespace"; + }; +/* End PBXAggregateTarget section */ + /* Begin PBXBuildFile section */ + 31ED52E81D73891B00199085 /* AFError+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31ED52E61D73889D00199085 /* AFError+AlamofireTests.swift */; }; + 31ED52E91D73891C00199085 /* AFError+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31ED52E61D73889D00199085 /* AFError+AlamofireTests.swift */; }; + 31ED52EA1D73891C00199085 /* AFError+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31ED52E61D73889D00199085 /* AFError+AlamofireTests.swift */; }; 4C0B58391B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */; }; 4C0B583A1B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */; }; 4C0B62511BB1001C009302D3 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; @@ -14,8 +31,8 @@ 4C0B62531BB1001C009302D3 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; 4C0E5BF81B673D3400816CCC /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; 4C0E5BF91B673D3400816CCC /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; - 4C1DC8541B68908E00476DE3 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; - 4C1DC8551B68908E00476DE3 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; + 4C1DC8541B68908E00476DE3 /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* AFError.swift */; }; + 4C1DC8551B68908E00476DE3 /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* AFError.swift */; }; 4C23EB431B327C5B0090E0BC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; 4C23EB441B327C5B0090E0BC /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; 4C256A531B096C770065714F /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C256A501B096C2C0065714F /* BaseTestCase.swift */; }; @@ -30,91 +47,139 @@ 4C33A1441B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */; }; 4C341BBA1B1A865A00C1B34D /* CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C341BB91B1A865A00C1B34D /* CacheTests.swift */; }; 4C341BBB1B1A865A00C1B34D /* CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C341BB91B1A865A00C1B34D /* CacheTests.swift */; }; + 4C3D00541C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; + 4C3D00551C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; + 4C3D00561C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; + 4C3D00581C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */; }; + 4C3D00591C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */; }; + 4C3D005A1C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */; }; + 4C43669B1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C43669A1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift */; }; + 4C43669C1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C43669A1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift */; }; + 4C43669D1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C43669A1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift */; }; + 4C43669E1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C43669A1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift */; }; 4C4CBE7B1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; 4C4CBE7C1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; - 4C7C8D221B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */; }; - 4C7C8D231B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */; }; + 4C574E6A1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; + 4C574E6B1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; + 4C574E6C1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; + 4C574E6D1C67D207000B3128 /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C574E691C67D207000B3128 /* Timeline.swift */; }; + 4C743CF61C22772D00BCB23E /* certDER.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F831C1A72F8002DA1A9 /* certDER.cer */; }; + 4C743CF71C22772D00BCB23E /* certDER.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F841C1A72F8002DA1A9 /* certDER.crt */; }; + 4C743CF81C22772D00BCB23E /* certDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F851C1A72F8002DA1A9 /* certDER.der */; }; + 4C743CF91C22772D00BCB23E /* certPEM.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F861C1A72F8002DA1A9 /* certPEM.cer */; }; + 4C743CFA1C22772D00BCB23E /* certPEM.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F871C1A72F8002DA1A9 /* certPEM.crt */; }; + 4C743CFB1C22772D00BCB23E /* randomGibberish.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */; }; + 4C743CFC1C22772D00BCB23E /* keyDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */; }; + 4C743CFD1C22772D00BCB23E /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; + 4C743CFE1C22772D00BCB23E /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; + 4C743CFF1C22772D00BCB23E /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; + 4C743D001C22772D00BCB23E /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; + 4C743D011C22772D00BCB23E /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; + 4C743D021C22772D00BCB23E /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; + 4C743D031C22772D00BCB23E /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; + 4C743D041C22772D00BCB23E /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; + 4C743D051C22772D00BCB23E /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; + 4C743D061C22772D00BCB23E /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; + 4C743D071C22772D00BCB23E /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; + 4C743D081C22772D00BCB23E /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; + 4C743D0C1C22772E00BCB23E /* certDER.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F831C1A72F8002DA1A9 /* certDER.cer */; }; + 4C743D0D1C22772E00BCB23E /* certDER.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F841C1A72F8002DA1A9 /* certDER.crt */; }; + 4C743D0E1C22772E00BCB23E /* certDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F851C1A72F8002DA1A9 /* certDER.der */; }; + 4C743D0F1C22772E00BCB23E /* certPEM.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F861C1A72F8002DA1A9 /* certPEM.cer */; }; + 4C743D101C22772E00BCB23E /* certPEM.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F871C1A72F8002DA1A9 /* certPEM.crt */; }; + 4C743D111C22772E00BCB23E /* randomGibberish.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */; }; + 4C743D121C22772E00BCB23E /* keyDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */; }; + 4C743D131C22772E00BCB23E /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; + 4C743D141C22772E00BCB23E /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; + 4C743D151C22772E00BCB23E /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; + 4C743D161C22772E00BCB23E /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; + 4C743D171C22772E00BCB23E /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; + 4C743D181C22772E00BCB23E /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; + 4C743D191C22772E00BCB23E /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; + 4C743D1A1C22772E00BCB23E /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; + 4C743D1B1C22772E00BCB23E /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; + 4C743D1C1C22772E00BCB23E /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; + 4C743D1D1C22772E00BCB23E /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; + 4C743D1E1C22772E00BCB23E /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; + 4C743D221C22772F00BCB23E /* certDER.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F831C1A72F8002DA1A9 /* certDER.cer */; }; + 4C743D231C22772F00BCB23E /* certDER.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F841C1A72F8002DA1A9 /* certDER.crt */; }; + 4C743D241C22772F00BCB23E /* certDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F851C1A72F8002DA1A9 /* certDER.der */; }; + 4C743D251C22772F00BCB23E /* certPEM.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F861C1A72F8002DA1A9 /* certPEM.cer */; }; + 4C743D261C22772F00BCB23E /* certPEM.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F871C1A72F8002DA1A9 /* certPEM.crt */; }; + 4C743D271C22772F00BCB23E /* randomGibberish.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */; }; + 4C743D281C22772F00BCB23E /* keyDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */; }; + 4C743D291C22772F00BCB23E /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; + 4C743D2A1C22772F00BCB23E /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; + 4C743D2B1C22772F00BCB23E /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; + 4C743D2C1C22772F00BCB23E /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; + 4C743D2D1C22772F00BCB23E /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; + 4C743D2E1C22772F00BCB23E /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; + 4C743D2F1C22772F00BCB23E /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; + 4C743D301C22772F00BCB23E /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; + 4C743D311C22772F00BCB23E /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; + 4C743D321C22772F00BCB23E /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; + 4C743D331C22772F00BCB23E /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; + 4C743D341C22772F00BCB23E /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; 4C80F9F81BB730EF001B46D2 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0B62501BB1001C009302D3 /* Response.swift */; }; 4C80F9F91BB730F6001B46D2 /* String+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */; }; 4C811F8D1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; 4C811F8E1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - 4C812C3B1B535F220017E0BF /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; - 4C812C3C1B535F220017E0BF /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; - 4C812C3F1B535F2E0017E0BF /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; - 4C812C401B535F2E0017E0BF /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; - 4C812C411B535F2E0017E0BF /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; - 4C812C421B535F2E0017E0BF /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; - 4C812C471B535F400017E0BF /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; - 4C812C481B535F400017E0BF /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; - 4C812C491B535F400017E0BF /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; - 4C812C4A1B535F400017E0BF /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; - 4C812C4B1B535F400017E0BF /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; - 4C812C4C1B535F400017E0BF /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; - 4C812C4D1B535F400017E0BF /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; - 4C812C4E1B535F400017E0BF /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; - 4C812C541B535F540017E0BF /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; - 4C812C551B535F540017E0BF /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; - 4C812C561B535F540017E0BF /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; - 4C812C571B535F540017E0BF /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; - 4C812C581B535F540017E0BF /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; - 4C812C591B535F540017E0BF /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; - 4C812C5A1B535F540017E0BF /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; - 4C812C5B1B535F540017E0BF /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; - 4C812C5C1B535F540017E0BF /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; - 4C812C5D1B535F540017E0BF /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; - 4C812C611B535F6D0017E0BF /* intermediate-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */; }; - 4C812C621B535F6D0017E0BF /* intermediate-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */; }; - 4C812C631B535F6D0017E0BF /* root-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */; }; - 4C812C641B535F6D0017E0BF /* root-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */; }; - 4C812C651B535F6D0017E0BF /* testssl-expire.disig.sk.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */; }; - 4C812C661B535F6D0017E0BF /* testssl-expire.disig.sk.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */; }; - 4C83F41B1B749E0E00203445 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4C83F41C1B749E0E00203445 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4C83F41D1B749E0E00203445 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; + 4C9DCE781CB1BCE2003E6463 /* SessionDelegateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C9DCE771CB1BCE2003E6463 /* SessionDelegateTests.swift */; }; + 4C9DCE791CB1BCE2003E6463 /* SessionDelegateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C9DCE771CB1BCE2003E6463 /* SessionDelegateTests.swift */; }; + 4C9DCE7A1CB1BCE2003E6463 /* SessionDelegateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C9DCE771CB1BCE2003E6463 /* SessionDelegateTests.swift */; }; 4CA028C51B7466C500C84163 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CA028C41B7466C500C84163 /* ResultTests.swift */; }; 4CA028C61B7466C500C84163 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CA028C41B7466C500C84163 /* ResultTests.swift */; }; + 4CB928291C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; + 4CB9282A1C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; + 4CB9282B1C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; + 4CB9282C1C66BFBC00CE5F08 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CB928281C66BFBC00CE5F08 /* Notifications.swift */; }; + 4CCB206C1D4549E000C64D5B /* expired.badssl.com-leaf.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB20681D4549E000C64D5B /* expired.badssl.com-leaf.cer */; }; + 4CCB206D1D4549E000C64D5B /* expired.badssl.com-leaf.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB20681D4549E000C64D5B /* expired.badssl.com-leaf.cer */; }; + 4CCB206E1D4549E000C64D5B /* expired.badssl.com-leaf.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB20681D4549E000C64D5B /* expired.badssl.com-leaf.cer */; }; + 4CCB206F1D4549E000C64D5B /* expired.badssl.com-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB20691D4549E000C64D5B /* expired.badssl.com-root-ca.cer */; }; + 4CCB20701D4549E000C64D5B /* expired.badssl.com-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB20691D4549E000C64D5B /* expired.badssl.com-root-ca.cer */; }; + 4CCB20711D4549E000C64D5B /* expired.badssl.com-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB20691D4549E000C64D5B /* expired.badssl.com-root-ca.cer */; }; + 4CCB20721D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB206A1D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer */; }; + 4CCB20731D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB206A1D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer */; }; + 4CCB20741D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB206A1D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer */; }; + 4CCB20751D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB206B1D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer */; }; + 4CCB20761D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB206B1D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer */; }; + 4CCB20771D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4CCB206B1D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer */; }; 4CCFA79A1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */; }; 4CCFA79B1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */; }; - 4CDE2C371AF8932A00BABAE5 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; - 4CDE2C381AF8932A00BABAE5 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; + 4CDE2C371AF8932A00BABAE5 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* SessionManager.swift */; }; + 4CDE2C381AF8932A00BABAE5 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* SessionManager.swift */; }; 4CDE2C3A1AF899EC00BABAE5 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; 4CDE2C3B1AF899EC00BABAE5 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; - 4CDE2C3D1AF89D4900BABAE5 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; - 4CDE2C3E1AF89D4900BABAE5 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; - 4CDE2C401AF89E0700BABAE5 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; - 4CDE2C411AF89E0700BABAE5 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; 4CDE2C431AF89F0900BABAE5 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; 4CDE2C441AF89F0900BABAE5 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; 4CDE2C461AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; 4CDE2C471AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; 4CE2724F1AF88FB500F1D59A /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; 4CE272501AF88FB500F1D59A /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; - 4CEC605A1B745C9100E684F4 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; + 4CEC605A1B745C9100E684F4 /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* AFError.swift */; }; 4CEC605B1B745C9100E684F4 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; 4CEC605C1B745C9B00E684F4 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4CEE82AD1C6813CF00E9C9F0 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */; }; 4CF626F91BA7CB3E0011A099 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */; }; 4CF627061BA7CBE30011A099 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4CF627071BA7CBF60011A099 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; - 4CF627081BA7CBF60011A099 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* Error.swift */; }; - 4CF627091BA7CBF60011A099 /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; + 4CF627081BA7CBF60011A099 /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C1DC8531B68908E00476DE3 /* AFError.swift */; }; + 4CF627091BA7CBF60011A099 /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* SessionManager.swift */; }; 4CF6270A1BA7CBF60011A099 /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; 4CF6270B1BA7CBF60011A099 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; 4CF6270C1BA7CBF60011A099 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0E5BF71B673D3400816CCC /* Result.swift */; }; - 4CF6270D1BA7CBF60011A099 /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; 4CF6270E1BA7CBF60011A099 /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; 4CF6270F1BA7CBF60011A099 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; 4CF627101BA7CBF60011A099 /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - 4CF627111BA7CBF60011A099 /* Stream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C83F41A1B749E0E00203445 /* Stream.swift */; }; - 4CF627121BA7CBF60011A099 /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; 4CF627131BA7CBF60011A099 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; 4CF627141BA7CC240011A099 /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C256A501B096C2C0065714F /* BaseTestCase.swift */; }; 4CF627151BA7CC240011A099 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; }; - 4CF627161BA7CC240011A099 /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; + 4CF627161BA7CC240011A099 /* SessionManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* SessionManagerTests.swift */; }; 4CF627171BA7CC240011A099 /* ParameterEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */; }; 4CF627181BA7CC240011A099 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; }; 4CF627191BA7CC240011A099 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; 4CF6271A1BA7CC240011A099 /* ResultTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CA028C41B7466C500C84163 /* ResultTests.swift */; }; - 4CF6271B1BA7CC240011A099 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */; }; 4CF6271C1BA7CC240011A099 /* CacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C341BB91B1A865A00C1B34D /* CacheTests.swift */; }; 4CF6271D1BA7CC240011A099 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; 4CF6271E1BA7CC240011A099 /* MultipartFormDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */; }; @@ -124,42 +189,56 @@ 4CF627221BA7CC240011A099 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5F19A9674D0040E7D1 /* UploadTests.swift */; }; 4CF627231BA7CC240011A099 /* URLProtocolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */; }; 4CF627241BA7CC240011A099 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; }; - 4CF627251BA7CC300011A099 /* alamofire-root-ca.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */; }; - 4CF627261BA7CC300011A099 /* alamofire-signing-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */; }; - 4CF627271BA7CC300011A099 /* alamofire-signing-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C3E1B535F2E0017E0BF /* alamofire-signing-ca2.cer */; }; - 4CF627281BA7CC300011A099 /* multiple-dns-names.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C441B535F400017E0BF /* multiple-dns-names.cer */; }; - 4CF627291BA7CC300011A099 /* signed-by-ca1.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C451B535F400017E0BF /* signed-by-ca1.cer */; }; - 4CF6272A1BA7CC300011A099 /* test.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C461B535F400017E0BF /* test.alamofire.org.cer */; }; - 4CF6272B1BA7CC300011A099 /* wildcard.alamofire.org.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C431B535F400017E0BF /* wildcard.alamofire.org.cer */; }; - 4CF6272C1BA7CC300011A099 /* expired.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C4F1B535F540017E0BF /* expired.cer */; }; - 4CF6272D1BA7CC300011A099 /* missing-dns-name-and-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C501B535F540017E0BF /* missing-dns-name-and-uri.cer */; }; - 4CF6272E1BA7CC300011A099 /* signed-by-ca2.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C511B535F540017E0BF /* signed-by-ca2.cer */; }; - 4CF6272F1BA7CC300011A099 /* valid-dns-name.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C521B535F540017E0BF /* valid-dns-name.cer */; }; - 4CF627301BA7CC300011A099 /* valid-uri.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C531B535F540017E0BF /* valid-uri.cer */; }; - 4CF627311BA7CC300011A099 /* intermediate-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */; }; - 4CF627321BA7CC300011A099 /* root-ca-disig.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */; }; - 4CF627331BA7CC300011A099 /* testssl-expire.disig.sk.cer in Resources */ = {isa = PBXBuildFile; fileRef = 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */; }; 4CF627341BA7CC300011A099 /* rainbow.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1231B5207DB00873DFF /* rainbow.jpg */; }; 4CF627351BA7CC300011A099 /* unicorn.png in Resources */ = {isa = PBXBuildFile; fileRef = 4C33A1241B5207DB00873DFF /* unicorn.png */; }; + 4CFB02901D7CF28F0056F249 /* FileManager+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFB028F1D7CF28F0056F249 /* FileManager+AlamofireTests.swift */; }; + 4CFB02911D7CF28F0056F249 /* FileManager+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFB028F1D7CF28F0056F249 /* FileManager+AlamofireTests.swift */; }; + 4CFB02921D7CF28F0056F249 /* FileManager+AlamofireTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFB028F1D7CF28F0056F249 /* FileManager+AlamofireTests.swift */; }; + 4CFB02F51D7D2FA20056F249 /* empty_data.json in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EA1D7D2FA20056F249 /* empty_data.json */; }; + 4CFB02F61D7D2FA20056F249 /* empty_data.json in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EA1D7D2FA20056F249 /* empty_data.json */; }; + 4CFB02F71D7D2FA20056F249 /* empty_data.json in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EA1D7D2FA20056F249 /* empty_data.json */; }; + 4CFB02F81D7D2FA20056F249 /* invalid_data.json in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EB1D7D2FA20056F249 /* invalid_data.json */; }; + 4CFB02F91D7D2FA20056F249 /* invalid_data.json in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EB1D7D2FA20056F249 /* invalid_data.json */; }; + 4CFB02FA1D7D2FA20056F249 /* invalid_data.json in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EB1D7D2FA20056F249 /* invalid_data.json */; }; + 4CFB02FB1D7D2FA20056F249 /* valid_data.json in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EC1D7D2FA20056F249 /* valid_data.json */; }; + 4CFB02FC1D7D2FA20056F249 /* valid_data.json in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EC1D7D2FA20056F249 /* valid_data.json */; }; + 4CFB02FD1D7D2FA20056F249 /* valid_data.json in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EC1D7D2FA20056F249 /* valid_data.json */; }; + 4CFB02FE1D7D2FA20056F249 /* empty.data in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EE1D7D2FA20056F249 /* empty.data */; }; + 4CFB02FF1D7D2FA20056F249 /* empty.data in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EE1D7D2FA20056F249 /* empty.data */; }; + 4CFB03001D7D2FA20056F249 /* empty.data in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EE1D7D2FA20056F249 /* empty.data */; }; + 4CFB03011D7D2FA20056F249 /* invalid.data in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EF1D7D2FA20056F249 /* invalid.data */; }; + 4CFB03021D7D2FA20056F249 /* invalid.data in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EF1D7D2FA20056F249 /* invalid.data */; }; + 4CFB03031D7D2FA20056F249 /* invalid.data in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02EF1D7D2FA20056F249 /* invalid.data */; }; + 4CFB03041D7D2FA20056F249 /* valid.data in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F01D7D2FA20056F249 /* valid.data */; }; + 4CFB03051D7D2FA20056F249 /* valid.data in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F01D7D2FA20056F249 /* valid.data */; }; + 4CFB03061D7D2FA20056F249 /* valid.data in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F01D7D2FA20056F249 /* valid.data */; }; + 4CFB03071D7D2FA20056F249 /* empty_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F21D7D2FA20056F249 /* empty_string.txt */; }; + 4CFB03081D7D2FA20056F249 /* empty_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F21D7D2FA20056F249 /* empty_string.txt */; }; + 4CFB03091D7D2FA20056F249 /* empty_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F21D7D2FA20056F249 /* empty_string.txt */; }; + 4CFB030A1D7D2FA20056F249 /* utf32_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F31D7D2FA20056F249 /* utf32_string.txt */; }; + 4CFB030B1D7D2FA20056F249 /* utf32_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F31D7D2FA20056F249 /* utf32_string.txt */; }; + 4CFB030C1D7D2FA20056F249 /* utf32_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F31D7D2FA20056F249 /* utf32_string.txt */; }; + 4CFB030D1D7D2FA20056F249 /* utf8_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F41D7D2FA20056F249 /* utf8_string.txt */; }; + 4CFB030E1D7D2FA20056F249 /* utf8_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F41D7D2FA20056F249 /* utf8_string.txt */; }; + 4CFB030F1D7D2FA20056F249 /* utf8_string.txt in Resources */ = {isa = PBXBuildFile; fileRef = 4CFB02F41D7D2FA20056F249 /* utf8_string.txt */; }; + 4CFCFE2E1D56D31700A76388 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFCFE2D1D56D31700A76388 /* SessionDelegate.swift */; }; + 4CFCFE2F1D56D31700A76388 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFCFE2D1D56D31700A76388 /* SessionDelegate.swift */; }; + 4CFCFE301D56D31700A76388 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFCFE2D1D56D31700A76388 /* SessionDelegate.swift */; }; + 4CFCFE311D56D31700A76388 /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFCFE2D1D56D31700A76388 /* SessionDelegate.swift */; }; + 4CFCFE391D56E8D900A76388 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFCFE381D56E8D900A76388 /* TaskDelegate.swift */; }; + 4CFCFE3A1D56E8D900A76388 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFCFE381D56E8D900A76388 /* TaskDelegate.swift */; }; + 4CFCFE3B1D56E8D900A76388 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFCFE381D56E8D900A76388 /* TaskDelegate.swift */; }; + 4CFCFE3C1D56E8D900A76388 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CFCFE381D56E8D900A76388 /* TaskDelegate.swift */; }; 4DD67C241A5C58FB00ED2280 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; 4DD67C251A5C590000ED2280 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; 8035DB621BAB492500466CB3 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F8111E3319A95C8B0040E7D1 /* Alamofire.framework */; }; - B39E2F951C1A744F002DA1A9 /* certDER.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F831C1A72F8002DA1A9 /* certDER.cer */; }; - B39E2F961C1A744F002DA1A9 /* certDER.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F841C1A72F8002DA1A9 /* certDER.crt */; }; - B39E2F971C1A744F002DA1A9 /* certDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F851C1A72F8002DA1A9 /* certDER.der */; }; - B39E2F981C1A744F002DA1A9 /* certPEM.cer in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F861C1A72F8002DA1A9 /* certPEM.cer */; }; - B39E2F991C1A744F002DA1A9 /* certPEM.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F871C1A72F8002DA1A9 /* certPEM.crt */; }; - B39E2F9B1C1A744F002DA1A9 /* randomGibberish.crt in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F891C1A72F8002DA1A9 /* randomGibberish.crt */; }; - B39E2F9C1C1A744F002DA1A9 /* keyDER.der in Resources */ = {isa = PBXBuildFile; fileRef = B39E2F8A1C1A72F8002DA1A9 /* keyDER.der */; }; - E4202FCF1B667AA100C997FB /* Upload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */; }; E4202FD01B667AA100C997FB /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */; }; E4202FD11B667AA100C997FB /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C391AF899EC00BABAE5 /* Request.swift */; }; E4202FD21B667AA100C997FB /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */; }; - E4202FD31B667AA100C997FB /* Manager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* Manager.swift */; }; + E4202FD31B667AA100C997FB /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C361AF8932A00BABAE5 /* SessionManager.swift */; }; E4202FD41B667AA100C997FB /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; E4202FD51B667AA100C997FB /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */; }; E4202FD61B667AA100C997FB /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */; }; - E4202FD71B667AA100C997FB /* Download.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */; }; E4202FD81B667AA100C997FB /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4CDE2C421AF89F0900BABAE5 /* Validation.swift */; }; F8111E3919A95C8B0040E7D1 /* Alamofire.h in Headers */ = {isa = PBXBuildFile; fileRef = F8111E3819A95C8B0040E7D1 /* Alamofire.h */; settings = {ATTRIBUTES = (Public, ); }; }; F8111E6019A9674D0040E7D1 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; @@ -168,7 +247,7 @@ F829C6B81A7A94F100A2CD59 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */; }; F829C6BE1A7A950600A2CD59 /* ParameterEncodingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */; }; F829C6BF1A7A950600A2CD59 /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5D19A9674D0040E7D1 /* RequestTests.swift */; }; - F829C6C01A7A950600A2CD59 /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; + F829C6C01A7A950600A2CD59 /* SessionManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* SessionManagerTests.swift */; }; F829C6C11A7A950600A2CD59 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; F829C6C21A7A950600A2CD59 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5F19A9674D0040E7D1 /* UploadTests.swift */; }; F829C6C31A7A950600A2CD59 /* DownloadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */; }; @@ -180,7 +259,7 @@ F8858DDE19A96B4400F55F93 /* ResponseTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */; }; F897FF4119AA800700AB5182 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = F897FF4019AA800700AB5182 /* Alamofire.swift */; }; F8AE910219D28DCC0078C7B2 /* ValidationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */; }; - F8D1C6F519D52968002E74FE /* ManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* ManagerTests.swift */; }; + F8D1C6F519D52968002E74FE /* SessionManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8D1C6F419D52968002E74FE /* SessionManagerTests.swift */; }; F8E6024519CB46A800A3E7F1 /* AuthenticationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */; }; /* End PBXBuildFile section */ @@ -209,11 +288,12 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 31ED52E61D73889D00199085 /* AFError+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "AFError+AlamofireTests.swift"; sourceTree = ""; }; 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseSerializationTests.swift; sourceTree = ""; }; 4C0B62501BB1001C009302D3 /* Response.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Response.swift; sourceTree = ""; }; 4C0E02681BF99A18004E7F18 /* Info-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Info-tvOS.plist"; path = "Source/Info-tvOS.plist"; sourceTree = SOURCE_ROOT; }; 4C0E5BF71B673D3400816CCC /* Result.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Result.swift; sourceTree = ""; }; - 4C1DC8531B68908E00476DE3 /* Error.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Error.swift; sourceTree = ""; }; + 4C1DC8531B68908E00476DE3 /* AFError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AFError.swift; sourceTree = ""; }; 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultipartFormData.swift; sourceTree = ""; }; 4C256A501B096C2C0065714F /* BaseTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BaseTestCase.swift; sourceTree = ""; }; 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MultipartFormDataTests.swift; sourceTree = ""; }; @@ -221,8 +301,11 @@ 4C33A1241B5207DB00873DFF /* unicorn.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unicorn.png; sourceTree = ""; }; 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerTrustPolicyTests.swift; sourceTree = ""; }; 4C341BB91B1A865A00C1B34D /* CacheTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CacheTests.swift; sourceTree = ""; }; + 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkReachabilityManager.swift; sourceTree = ""; }; + 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkReachabilityManagerTests.swift; sourceTree = ""; }; + 4C43669A1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "DispatchQueue+Alamofire.swift"; sourceTree = ""; }; 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+AlamofireTests.swift"; sourceTree = ""; }; - 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NSURLSessionConfiguration+AlamofireTests.swift"; sourceTree = ""; }; + 4C574E691C67D207000B3128 /* Timeline.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Timeline.swift; sourceTree = ""; }; 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ServerTrustPolicy.swift; sourceTree = ""; }; 4C812C3A1B535F220017E0BF /* alamofire-root-ca.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "alamofire-root-ca.cer"; path = "alamofire.org/alamofire-root-ca.cer"; sourceTree = ""; }; 4C812C3D1B535F2E0017E0BF /* alamofire-signing-ca1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "alamofire-signing-ca1.cer"; path = "alamofire.org/alamofire-signing-ca1.cer"; sourceTree = ""; }; @@ -236,21 +319,33 @@ 4C812C511B535F540017E0BF /* signed-by-ca2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "signed-by-ca2.cer"; path = "alamofire.org/signed-by-ca2.cer"; sourceTree = ""; }; 4C812C521B535F540017E0BF /* valid-dns-name.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "valid-dns-name.cer"; path = "alamofire.org/valid-dns-name.cer"; sourceTree = ""; }; 4C812C531B535F540017E0BF /* valid-uri.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "valid-uri.cer"; path = "alamofire.org/valid-uri.cer"; sourceTree = ""; }; - 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "intermediate-ca-disig.cer"; path = "disig.sk/intermediate-ca-disig.cer"; sourceTree = ""; }; - 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "root-ca-disig.cer"; path = "disig.sk/root-ca-disig.cer"; sourceTree = ""; }; - 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = "testssl-expire.disig.sk.cer"; path = "disig.sk/testssl-expire.disig.sk.cer"; sourceTree = ""; }; - 4C83F41A1B749E0E00203445 /* Stream.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Stream.swift; sourceTree = ""; }; + 4C9DCE771CB1BCE2003E6463 /* SessionDelegateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionDelegateTests.swift; sourceTree = ""; }; 4CA028C41B7466C500C84163 /* ResultTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResultTests.swift; sourceTree = ""; }; + 4CB928281C66BFBC00CE5F08 /* Notifications.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Notifications.swift; sourceTree = ""; }; + 4CCB20681D4549E000C64D5B /* expired.badssl.com-leaf.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "expired.badssl.com-leaf.cer"; sourceTree = ""; }; + 4CCB20691D4549E000C64D5B /* expired.badssl.com-root-ca.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "expired.badssl.com-root-ca.cer"; sourceTree = ""; }; + 4CCB206A1D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "expired.badssl.com-intermediate-ca-1.cer"; sourceTree = ""; }; + 4CCB206B1D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = "expired.badssl.com-intermediate-ca-2.cer"; sourceTree = ""; }; 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLProtocolTests.swift; sourceTree = ""; }; - 4CDE2C361AF8932A00BABAE5 /* Manager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Manager.swift; sourceTree = ""; }; + 4CDE2C361AF8932A00BABAE5 /* SessionManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionManager.swift; sourceTree = ""; }; 4CDE2C391AF899EC00BABAE5 /* Request.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = ""; }; - 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Download.swift; sourceTree = ""; }; - 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Upload.swift; sourceTree = ""; }; 4CDE2C421AF89F0900BABAE5 /* Validation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Validation.swift; sourceTree = ""; }; 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseSerialization.swift; sourceTree = ""; }; 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ParameterEncoding.swift; sourceTree = ""; }; 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 4CF626F81BA7CB3E0011A099 /* Alamofire tvOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire tvOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + 4CFB028F1D7CF28F0056F249 /* FileManager+AlamofireTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FileManager+AlamofireTests.swift"; sourceTree = ""; }; + 4CFB02EA1D7D2FA20056F249 /* empty_data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = empty_data.json; sourceTree = ""; }; + 4CFB02EB1D7D2FA20056F249 /* invalid_data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = invalid_data.json; sourceTree = ""; }; + 4CFB02EC1D7D2FA20056F249 /* valid_data.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = valid_data.json; sourceTree = ""; }; + 4CFB02EE1D7D2FA20056F249 /* empty.data */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = empty.data; sourceTree = ""; }; + 4CFB02EF1D7D2FA20056F249 /* invalid.data */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = invalid.data; sourceTree = ""; }; + 4CFB02F01D7D2FA20056F249 /* valid.data */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = valid.data; sourceTree = ""; }; + 4CFB02F21D7D2FA20056F249 /* empty_string.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = empty_string.txt; sourceTree = ""; }; + 4CFB02F31D7D2FA20056F249 /* utf32_string.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = utf32_string.txt; sourceTree = ""; }; + 4CFB02F41D7D2FA20056F249 /* utf8_string.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = utf8_string.txt; sourceTree = ""; }; + 4CFCFE2D1D56D31700A76388 /* SessionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionDelegate.swift; sourceTree = ""; }; + 4CFCFE381D56E8D900A76388 /* TaskDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TaskDelegate.swift; sourceTree = ""; }; 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 72998D721BF26173006D3F69 /* Info-tvOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Info-tvOS.plist"; sourceTree = ""; }; B39E2F831C1A72F8002DA1A9 /* certDER.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = certDER.cer; path = selfSignedAndMalformedCerts/certDER.cer; sourceTree = ""; }; @@ -271,11 +366,11 @@ F8111E5D19A9674D0040E7D1 /* RequestTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestTests.swift; sourceTree = ""; }; F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ResponseTests.swift; sourceTree = ""; }; F8111E5F19A9674D0040E7D1 /* UploadTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UploadTests.swift; sourceTree = ""; }; - F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire OSX Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + F829C6B21A7A94F100A2CD59 /* Alamofire macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Alamofire macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TLSEvaluationTests.swift; sourceTree = ""; }; F897FF4019AA800700AB5182 /* Alamofire.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Alamofire.swift; sourceTree = ""; }; F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ValidationTests.swift; sourceTree = ""; }; - F8D1C6F419D52968002E74FE /* ManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManagerTests.swift; sourceTree = ""; }; + F8D1C6F419D52968002E74FE /* SessionManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SessionManagerTests.swift; sourceTree = ""; }; F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AuthenticationTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -339,11 +434,14 @@ isa = PBXGroup; children = ( F8E6024419CB46A800A3E7F1 /* AuthenticationTests.swift */, - F8D1C6F419D52968002E74FE /* ManagerTests.swift */, + F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */, F8111E5C19A9674D0040E7D1 /* ParameterEncodingTests.swift */, F8111E5D19A9674D0040E7D1 /* RequestTests.swift */, F8111E5E19A9674D0040E7D1 /* ResponseTests.swift */, 4CA028C41B7466C500C84163 /* ResultTests.swift */, + 4C9DCE771CB1BCE2003E6463 /* SessionDelegateTests.swift */, + F8D1C6F419D52968002E74FE /* SessionManagerTests.swift */, + F8111E5F19A9674D0040E7D1 /* UploadTests.swift */, ); name = Core; sourceTree = ""; @@ -352,12 +450,11 @@ isa = PBXGroup; children = ( 4C341BB91B1A865A00C1B34D /* CacheTests.swift */, - F8111E5B19A9674D0040E7D1 /* DownloadTests.swift */, 4C3238E61B3604DB00FE04AE /* MultipartFormDataTests.swift */, + 4C3D00571C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift */, 4C0B58381B747A4400C0B99C /* ResponseSerializationTests.swift */, 4C33A1421B52089C00873DFF /* ServerTrustPolicyTests.swift */, F86AEFE51AE6A282007D9C76 /* TLSEvaluationTests.swift */, - F8111E5F19A9674D0040E7D1 /* UploadTests.swift */, 4CCFA7991B2BE71600B6F460 /* URLProtocolTests.swift */, F8AE910119D28DCC0078C7B2 /* ValidationTests.swift */, ); @@ -369,6 +466,7 @@ children = ( 4C33A1171B5207DB00873DFF /* Certificates */, 4C33A1221B5207DB00873DFF /* Images */, + 4CFB02E81D7D2FA20056F249 /* Responses */, ); name = Resources; sourceTree = ""; @@ -376,9 +474,9 @@ 4C33A1171B5207DB00873DFF /* Certificates */ = { isa = PBXGroup; children = ( - B39E2F821C1A72E5002DA1A9 /* Varying Encoding Types and Extensions */, 4C812C391B535F060017E0BF /* alamofire.org */, - 4C812C381B535F000017E0BF /* disig.sk */, + 4CCB20671D4549E000C64D5B /* expired.badssl.com */, + B39E2F821C1A72E5002DA1A9 /* Varying Encoding Types and Extensions */, ); name = Certificates; path = Resources/Certificates; @@ -443,23 +541,22 @@ name = "Signed by CA2"; sourceTree = ""; }; - 4C7C8D201B9D0D7300948136 /* Extensions */ = { + 4C4366991D7BB92700C38AAD /* Extensions */ = { isa = PBXGroup; children = ( - 4C7C8D211B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift */, - 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */, + 4C43669A1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift */, ); name = Extensions; sourceTree = ""; }; - 4C812C381B535F000017E0BF /* disig.sk */ = { + 4C7C8D201B9D0D7300948136 /* Extensions */ = { isa = PBXGroup; children = ( - 4C812C5E1B535F6D0017E0BF /* intermediate-ca-disig.cer */, - 4C812C5F1B535F6D0017E0BF /* root-ca-disig.cer */, - 4C812C601B535F6D0017E0BF /* testssl-expire.disig.sk.cer */, + 31ED52E61D73889D00199085 /* AFError+AlamofireTests.swift */, + 4CFB028F1D7CF28F0056F249 /* FileManager+AlamofireTests.swift */, + 4C4CBE7A1BAF700C0024D659 /* String+AlamofireTests.swift */, ); - name = disig.sk; + name = Extensions; sourceTree = ""; }; 4C812C391B535F060017E0BF /* alamofire.org */ = { @@ -472,15 +569,29 @@ name = alamofire.org; sourceTree = ""; }; + 4CCB20671D4549E000C64D5B /* expired.badssl.com */ = { + isa = PBXGroup; + children = ( + 4CCB20681D4549E000C64D5B /* expired.badssl.com-leaf.cer */, + 4CCB206A1D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer */, + 4CCB206B1D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer */, + 4CCB20691D4549E000C64D5B /* expired.badssl.com-root-ca.cer */, + ); + path = expired.badssl.com; + sourceTree = ""; + }; 4CDE2C481AF8A14A00BABAE5 /* Core */ = { isa = PBXGroup; children = ( - 4C1DC8531B68908E00476DE3 /* Error.swift */, - 4CDE2C361AF8932A00BABAE5 /* Manager.swift */, + 4C1DC8531B68908E00476DE3 /* AFError.swift */, + 4CB928281C66BFBC00CE5F08 /* Notifications.swift */, 4CE2724E1AF88FB500F1D59A /* ParameterEncoding.swift */, 4CDE2C391AF899EC00BABAE5 /* Request.swift */, 4C0B62501BB1001C009302D3 /* Response.swift */, 4C0E5BF71B673D3400816CCC /* Result.swift */, + 4CFCFE2D1D56D31700A76388 /* SessionDelegate.swift */, + 4CDE2C361AF8932A00BABAE5 /* SessionManager.swift */, + 4CFCFE381D56E8D900A76388 /* TaskDelegate.swift */, ); name = Core; sourceTree = ""; @@ -488,17 +599,57 @@ 4CDE2C491AF8A14E00BABAE5 /* Features */ = { isa = PBXGroup; children = ( - 4CDE2C3C1AF89D4900BABAE5 /* Download.swift */, 4C23EB421B327C5B0090E0BC /* MultipartFormData.swift */, + 4C3D00531C66A63000D1F709 /* NetworkReachabilityManager.swift */, 4CDE2C451AF89FF300BABAE5 /* ResponseSerialization.swift */, 4C811F8C1B51856D00E0F59A /* ServerTrustPolicy.swift */, - 4C83F41A1B749E0E00203445 /* Stream.swift */, - 4CDE2C3F1AF89E0700BABAE5 /* Upload.swift */, + 4C574E691C67D207000B3128 /* Timeline.swift */, 4CDE2C421AF89F0900BABAE5 /* Validation.swift */, ); name = Features; sourceTree = ""; }; + 4CFB02E81D7D2FA20056F249 /* Responses */ = { + isa = PBXGroup; + children = ( + 4CFB02E91D7D2FA20056F249 /* JSON */, + 4CFB02ED1D7D2FA20056F249 /* Property List */, + 4CFB02F11D7D2FA20056F249 /* String */, + ); + name = Responses; + path = Resources/Responses; + sourceTree = ""; + }; + 4CFB02E91D7D2FA20056F249 /* JSON */ = { + isa = PBXGroup; + children = ( + 4CFB02EA1D7D2FA20056F249 /* empty_data.json */, + 4CFB02EB1D7D2FA20056F249 /* invalid_data.json */, + 4CFB02EC1D7D2FA20056F249 /* valid_data.json */, + ); + path = JSON; + sourceTree = ""; + }; + 4CFB02ED1D7D2FA20056F249 /* Property List */ = { + isa = PBXGroup; + children = ( + 4CFB02EE1D7D2FA20056F249 /* empty.data */, + 4CFB02EF1D7D2FA20056F249 /* invalid.data */, + 4CFB02F01D7D2FA20056F249 /* valid.data */, + ); + path = "Property List"; + sourceTree = ""; + }; + 4CFB02F11D7D2FA20056F249 /* String */ = { + isa = PBXGroup; + children = ( + 4CFB02F21D7D2FA20056F249 /* empty_string.txt */, + 4CFB02F31D7D2FA20056F249 /* utf32_string.txt */, + 4CFB02F41D7D2FA20056F249 /* utf8_string.txt */, + ); + path = String; + sourceTree = ""; + }; B39E2F821C1A72E5002DA1A9 /* Varying Encoding Types and Extensions */ = { isa = PBXGroup; children = ( @@ -520,7 +671,10 @@ F8111E3F19A95C8B0040E7D1 /* Tests */, F8111E3419A95C8B0040E7D1 /* Products */, ); + indentWidth = 4; sourceTree = ""; + tabWidth = 4; + usesTabs = 0; }; F8111E3419A95C8B0040E7D1 /* Products */ = { isa = PBXGroup; @@ -528,7 +682,7 @@ F8111E3319A95C8B0040E7D1 /* Alamofire.framework */, F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */, 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */, - F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */, + F829C6B21A7A94F100A2CD59 /* Alamofire macOS Tests.xctest */, E4202FE01B667AA100C997FB /* Alamofire.framework */, 4CF626EF1BA7CB3E0011A099 /* Alamofire.framework */, 4CF626F81BA7CB3E0011A099 /* Alamofire tvOS Tests.xctest */, @@ -541,6 +695,7 @@ children = ( F897FF4019AA800700AB5182 /* Alamofire.swift */, 4CDE2C481AF8A14A00BABAE5 /* Core */, + 4C4366991D7BB92700C38AAD /* Extensions */, 4CDE2C491AF8A14E00BABAE5 /* Features */, F8111E3619A95C8B0040E7D1 /* Supporting Files */, ); @@ -653,9 +808,9 @@ productReference = 4CF626F81BA7CB3E0011A099 /* Alamofire tvOS Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */ = { + 4DD67C0A1A5C55C900ED2280 /* Alamofire macOS */ = { isa = PBXNativeTarget; - buildConfigurationList = 4DD67C1E1A5C55C900ED2280 /* Build configuration list for PBXNativeTarget "Alamofire OSX" */; + buildConfigurationList = 4DD67C1E1A5C55C900ED2280 /* Build configuration list for PBXNativeTarget "Alamofire macOS" */; buildPhases = ( 4DD67C061A5C55C900ED2280 /* Sources */, 4DD67C071A5C55C900ED2280 /* Frameworks */, @@ -666,7 +821,7 @@ ); dependencies = ( ); - name = "Alamofire OSX"; + name = "Alamofire macOS"; productName = AlamofireOSX; productReference = 4DD67C0B1A5C55C900ED2280 /* Alamofire.framework */; productType = "com.apple.product-type.framework"; @@ -725,9 +880,9 @@ productReference = F8111E3E19A95C8B0040E7D1 /* Alamofire iOS Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - F829C6B11A7A94F100A2CD59 /* Alamofire OSX Tests */ = { + F829C6B11A7A94F100A2CD59 /* Alamofire macOS Tests */ = { isa = PBXNativeTarget; - buildConfigurationList = F829C6BB1A7A94F100A2CD59 /* Build configuration list for PBXNativeTarget "Alamofire OSX Tests" */; + buildConfigurationList = F829C6BB1A7A94F100A2CD59 /* Build configuration list for PBXNativeTarget "Alamofire macOS Tests" */; buildPhases = ( F829C6AE1A7A94F100A2CD59 /* Sources */, F829C6AF1A7A94F100A2CD59 /* Frameworks */, @@ -738,9 +893,9 @@ dependencies = ( F829C6BA1A7A94F100A2CD59 /* PBXTargetDependency */, ); - name = "Alamofire OSX Tests"; + name = "Alamofire macOS Tests"; productName = "Alamofire OSX Tests"; - productReference = F829C6B21A7A94F100A2CD59 /* Alamofire OSX Tests.xctest */; + productReference = F829C6B21A7A94F100A2CD59 /* Alamofire macOS Tests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; /* End PBXNativeTarget section */ @@ -750,26 +905,39 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0700; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = Alamofire; TargetAttributes = { + 4CCB207C1D45563900C64D5B = { + CreatedOnToolsVersion = 7.3.1; + }; 4CF626EE1BA7CB3E0011A099 = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; }; 4CF626F71BA7CB3E0011A099 = { CreatedOnToolsVersion = 7.1; + LastSwiftMigration = 0800; }; 4DD67C0A1A5C55C900ED2280 = { CreatedOnToolsVersion = 6.1.1; + LastSwiftMigration = 0800; + ProvisioningStyle = Manual; + }; + E4202FCD1B667AA100C997FB = { + LastSwiftMigration = 0800; }; F8111E3219A95C8B0040E7D1 = { CreatedOnToolsVersion = 6.0; + LastSwiftMigration = 0800; }; F8111E3D19A95C8B0040E7D1 = { CreatedOnToolsVersion = 6.0; + LastSwiftMigration = 0800; }; F829C6B11A7A94F100A2CD59 = { CreatedOnToolsVersion = 6.1.1; + LastSwiftMigration = 0800; }; }; }; @@ -787,11 +955,12 @@ targets = ( F8111E3219A95C8B0040E7D1 /* Alamofire iOS */, F8111E3D19A95C8B0040E7D1 /* Alamofire iOS Tests */, - 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */, - F829C6B11A7A94F100A2CD59 /* Alamofire OSX Tests */, + 4DD67C0A1A5C55C900ED2280 /* Alamofire macOS */, + F829C6B11A7A94F100A2CD59 /* Alamofire macOS Tests */, 4CF626EE1BA7CB3E0011A099 /* Alamofire tvOS */, 4CF626F71BA7CB3E0011A099 /* Alamofire tvOS Tests */, E4202FCD1B667AA100C997FB /* Alamofire watchOS */, + 4CCB207C1D45563900C64D5B /* Cleanup Whitespace */, ); }; /* End PBXProject section */ @@ -808,23 +977,40 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 4CF627271BA7CC300011A099 /* alamofire-signing-ca2.cer in Resources */, - 4CF627311BA7CC300011A099 /* intermediate-ca-disig.cer in Resources */, - 4CF6272B1BA7CC300011A099 /* wildcard.alamofire.org.cer in Resources */, - 4CF627331BA7CC300011A099 /* testssl-expire.disig.sk.cer in Resources */, - 4CF6272F1BA7CC300011A099 /* valid-dns-name.cer in Resources */, - 4CF627291BA7CC300011A099 /* signed-by-ca1.cer in Resources */, - 4CF627321BA7CC300011A099 /* root-ca-disig.cer in Resources */, - 4CF6272A1BA7CC300011A099 /* test.alamofire.org.cer in Resources */, - 4CF6272E1BA7CC300011A099 /* signed-by-ca2.cer in Resources */, - 4CF6272C1BA7CC300011A099 /* expired.cer in Resources */, - 4CF6272D1BA7CC300011A099 /* missing-dns-name-and-uri.cer in Resources */, - 4CF627281BA7CC300011A099 /* multiple-dns-names.cer in Resources */, + 4C743D031C22772D00BCB23E /* wildcard.alamofire.org.cer in Resources */, + 4CCB20771D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer in Resources */, + 4C743CFF1C22772D00BCB23E /* alamofire-signing-ca2.cer in Resources */, + 4CFB03091D7D2FA20056F249 /* empty_string.txt in Resources */, + 4C743D061C22772D00BCB23E /* signed-by-ca2.cer in Resources */, 4CF627341BA7CC300011A099 /* rainbow.jpg in Resources */, - 4CF627251BA7CC300011A099 /* alamofire-root-ca.cer in Resources */, - 4CF627301BA7CC300011A099 /* valid-uri.cer in Resources */, + 4CCB20741D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer in Resources */, + 4C743D081C22772D00BCB23E /* valid-uri.cer in Resources */, + 4C743CFC1C22772D00BCB23E /* keyDER.der in Resources */, + 4CFB02FD1D7D2FA20056F249 /* valid_data.json in Resources */, + 4CCB206E1D4549E000C64D5B /* expired.badssl.com-leaf.cer in Resources */, + 4CFB030C1D7D2FA20056F249 /* utf32_string.txt in Resources */, + 4CFB030F1D7D2FA20056F249 /* utf8_string.txt in Resources */, + 4C743CF81C22772D00BCB23E /* certDER.der in Resources */, + 4C743D051C22772D00BCB23E /* missing-dns-name-and-uri.cer in Resources */, + 4C743CFB1C22772D00BCB23E /* randomGibberish.crt in Resources */, + 4C743CFE1C22772D00BCB23E /* alamofire-signing-ca1.cer in Resources */, + 4CFB03001D7D2FA20056F249 /* empty.data in Resources */, + 4C743D001C22772D00BCB23E /* multiple-dns-names.cer in Resources */, + 4C743D011C22772D00BCB23E /* signed-by-ca1.cer in Resources */, + 4CFB03031D7D2FA20056F249 /* invalid.data in Resources */, + 4C743D021C22772D00BCB23E /* test.alamofire.org.cer in Resources */, + 4C743CF61C22772D00BCB23E /* certDER.cer in Resources */, + 4C743CFD1C22772D00BCB23E /* alamofire-root-ca.cer in Resources */, + 4C743CF91C22772D00BCB23E /* certPEM.cer in Resources */, 4CF627351BA7CC300011A099 /* unicorn.png in Resources */, - 4CF627261BA7CC300011A099 /* alamofire-signing-ca1.cer in Resources */, + 4CFB03061D7D2FA20056F249 /* valid.data in Resources */, + 4C743CFA1C22772D00BCB23E /* certPEM.crt in Resources */, + 4C743CF71C22772D00BCB23E /* certDER.crt in Resources */, + 4CCB20711D4549E000C64D5B /* expired.badssl.com-root-ca.cer in Resources */, + 4C743D071C22772D00BCB23E /* valid-dns-name.cer in Resources */, + 4C743D041C22772D00BCB23E /* expired.cer in Resources */, + 4CFB02FA1D7D2FA20056F249 /* invalid_data.json in Resources */, + 4CFB02F71D7D2FA20056F249 /* empty_data.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -853,30 +1039,40 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 4C812C3B1B535F220017E0BF /* alamofire-root-ca.cer in Resources */, - B39E2F971C1A744F002DA1A9 /* certDER.der in Resources */, - 4C812C4B1B535F400017E0BF /* signed-by-ca1.cer in Resources */, - 4C812C541B535F540017E0BF /* expired.cer in Resources */, - 4C812C491B535F400017E0BF /* multiple-dns-names.cer in Resources */, - 4C812C4D1B535F400017E0BF /* test.alamofire.org.cer in Resources */, - B39E2F981C1A744F002DA1A9 /* certPEM.cer in Resources */, - 4C812C411B535F2E0017E0BF /* alamofire-signing-ca2.cer in Resources */, - B39E2F961C1A744F002DA1A9 /* certDER.crt in Resources */, + 4C743D2F1C22772F00BCB23E /* wildcard.alamofire.org.cer in Resources */, + 4CCB20751D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer in Resources */, + 4C743D2B1C22772F00BCB23E /* alamofire-signing-ca2.cer in Resources */, + 4CFB03071D7D2FA20056F249 /* empty_string.txt in Resources */, + 4C743D321C22772F00BCB23E /* signed-by-ca2.cer in Resources */, 4C33A13B1B5207DB00873DFF /* unicorn.png in Resources */, - 4C812C561B535F540017E0BF /* missing-dns-name-and-uri.cer in Resources */, - 4C812C581B535F540017E0BF /* signed-by-ca2.cer in Resources */, - 4C812C651B535F6D0017E0BF /* testssl-expire.disig.sk.cer in Resources */, - B39E2F951C1A744F002DA1A9 /* certDER.cer in Resources */, - 4C812C611B535F6D0017E0BF /* intermediate-ca-disig.cer in Resources */, + 4CCB20721D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer in Resources */, + 4C743D341C22772F00BCB23E /* valid-uri.cer in Resources */, + 4C743D281C22772F00BCB23E /* keyDER.der in Resources */, + 4CFB02FB1D7D2FA20056F249 /* valid_data.json in Resources */, + 4CCB206C1D4549E000C64D5B /* expired.badssl.com-leaf.cer in Resources */, + 4CFB030A1D7D2FA20056F249 /* utf32_string.txt in Resources */, + 4CFB030D1D7D2FA20056F249 /* utf8_string.txt in Resources */, + 4C743D241C22772F00BCB23E /* certDER.der in Resources */, + 4C743D311C22772F00BCB23E /* missing-dns-name-and-uri.cer in Resources */, + 4C743D271C22772F00BCB23E /* randomGibberish.crt in Resources */, + 4C743D2A1C22772F00BCB23E /* alamofire-signing-ca1.cer in Resources */, + 4CFB02FE1D7D2FA20056F249 /* empty.data in Resources */, + 4C743D2C1C22772F00BCB23E /* multiple-dns-names.cer in Resources */, + 4C743D2D1C22772F00BCB23E /* signed-by-ca1.cer in Resources */, + 4CFB03011D7D2FA20056F249 /* invalid.data in Resources */, + 4C743D2E1C22772F00BCB23E /* test.alamofire.org.cer in Resources */, + 4C743D221C22772F00BCB23E /* certDER.cer in Resources */, + 4C743D291C22772F00BCB23E /* alamofire-root-ca.cer in Resources */, + 4C743D251C22772F00BCB23E /* certPEM.cer in Resources */, 4C33A1391B5207DB00873DFF /* rainbow.jpg in Resources */, - 4C812C631B535F6D0017E0BF /* root-ca-disig.cer in Resources */, - 4C812C5C1B535F540017E0BF /* valid-uri.cer in Resources */, - B39E2F9B1C1A744F002DA1A9 /* randomGibberish.crt in Resources */, - 4C812C3F1B535F2E0017E0BF /* alamofire-signing-ca1.cer in Resources */, - B39E2F9C1C1A744F002DA1A9 /* keyDER.der in Resources */, - 4C812C5A1B535F540017E0BF /* valid-dns-name.cer in Resources */, - B39E2F991C1A744F002DA1A9 /* certPEM.crt in Resources */, - 4C812C471B535F400017E0BF /* wildcard.alamofire.org.cer in Resources */, + 4CFB03041D7D2FA20056F249 /* valid.data in Resources */, + 4C743D261C22772F00BCB23E /* certPEM.crt in Resources */, + 4C743D231C22772F00BCB23E /* certDER.crt in Resources */, + 4CCB206F1D4549E000C64D5B /* expired.badssl.com-root-ca.cer in Resources */, + 4C743D331C22772F00BCB23E /* valid-dns-name.cer in Resources */, + 4C743D301C22772F00BCB23E /* expired.cer in Resources */, + 4CFB02F81D7D2FA20056F249 /* invalid_data.json in Resources */, + 4CFB02F51D7D2FA20056F249 /* empty_data.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -884,46 +1080,83 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 4C812C3C1B535F220017E0BF /* alamofire-root-ca.cer in Resources */, - 4C812C4C1B535F400017E0BF /* signed-by-ca1.cer in Resources */, - 4C812C551B535F540017E0BF /* expired.cer in Resources */, - 4C812C4A1B535F400017E0BF /* multiple-dns-names.cer in Resources */, - 4C812C4E1B535F400017E0BF /* test.alamofire.org.cer in Resources */, - 4C812C421B535F2E0017E0BF /* alamofire-signing-ca2.cer in Resources */, + 4C743D191C22772E00BCB23E /* wildcard.alamofire.org.cer in Resources */, + 4CCB20761D4549E000C64D5B /* expired.badssl.com-intermediate-ca-2.cer in Resources */, + 4C743D151C22772E00BCB23E /* alamofire-signing-ca2.cer in Resources */, + 4CFB03081D7D2FA20056F249 /* empty_string.txt in Resources */, + 4C743D1C1C22772E00BCB23E /* signed-by-ca2.cer in Resources */, 4C33A13C1B5207DB00873DFF /* unicorn.png in Resources */, - 4C812C571B535F540017E0BF /* missing-dns-name-and-uri.cer in Resources */, - 4C812C591B535F540017E0BF /* signed-by-ca2.cer in Resources */, - 4C812C661B535F6D0017E0BF /* testssl-expire.disig.sk.cer in Resources */, - 4C812C621B535F6D0017E0BF /* intermediate-ca-disig.cer in Resources */, + 4CCB20731D4549E000C64D5B /* expired.badssl.com-intermediate-ca-1.cer in Resources */, + 4C743D1E1C22772E00BCB23E /* valid-uri.cer in Resources */, + 4C743D121C22772E00BCB23E /* keyDER.der in Resources */, + 4CFB02FC1D7D2FA20056F249 /* valid_data.json in Resources */, + 4CCB206D1D4549E000C64D5B /* expired.badssl.com-leaf.cer in Resources */, + 4CFB030B1D7D2FA20056F249 /* utf32_string.txt in Resources */, + 4CFB030E1D7D2FA20056F249 /* utf8_string.txt in Resources */, + 4C743D0E1C22772E00BCB23E /* certDER.der in Resources */, + 4C743D1B1C22772E00BCB23E /* missing-dns-name-and-uri.cer in Resources */, + 4C743D111C22772E00BCB23E /* randomGibberish.crt in Resources */, + 4C743D141C22772E00BCB23E /* alamofire-signing-ca1.cer in Resources */, + 4CFB02FF1D7D2FA20056F249 /* empty.data in Resources */, + 4C743D161C22772E00BCB23E /* multiple-dns-names.cer in Resources */, + 4C743D171C22772E00BCB23E /* signed-by-ca1.cer in Resources */, + 4CFB03021D7D2FA20056F249 /* invalid.data in Resources */, + 4C743D181C22772E00BCB23E /* test.alamofire.org.cer in Resources */, + 4C743D0C1C22772E00BCB23E /* certDER.cer in Resources */, + 4C743D131C22772E00BCB23E /* alamofire-root-ca.cer in Resources */, + 4C743D0F1C22772E00BCB23E /* certPEM.cer in Resources */, 4C33A13A1B5207DB00873DFF /* rainbow.jpg in Resources */, - 4C812C641B535F6D0017E0BF /* root-ca-disig.cer in Resources */, - 4C812C5D1B535F540017E0BF /* valid-uri.cer in Resources */, - 4C812C401B535F2E0017E0BF /* alamofire-signing-ca1.cer in Resources */, - 4C812C5B1B535F540017E0BF /* valid-dns-name.cer in Resources */, - 4C812C481B535F400017E0BF /* wildcard.alamofire.org.cer in Resources */, + 4CFB03051D7D2FA20056F249 /* valid.data in Resources */, + 4C743D101C22772E00BCB23E /* certPEM.crt in Resources */, + 4C743D0D1C22772E00BCB23E /* certDER.crt in Resources */, + 4CCB20701D4549E000C64D5B /* expired.badssl.com-root-ca.cer in Resources */, + 4C743D1D1C22772E00BCB23E /* valid-dns-name.cer in Resources */, + 4C743D1A1C22772E00BCB23E /* expired.cer in Resources */, + 4CFB02F91D7D2FA20056F249 /* invalid_data.json in Resources */, + 4CFB02F61D7D2FA20056F249 /* empty_data.json in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 4CCB20801D45564D00C64D5B /* Cleanup Whitespace */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 12; + files = ( + ); + inputPaths = ( + ); + name = "Cleanup Whitespace"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "#!/bin/sh\ndirectories=(Example Source Tests)\n\nfor directory in \"${directories[@]}\"\ndo\n echo \"Cleaning whitespace in directory: $directory\"\n find $directory -iregex '.*\\.swift' -exec sed -E -i '' -e 's/[[:blank:]]*$//' {} \\;\ndone\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 4CF626EA1BA7CB3E0011A099 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 4CF627121BA7CBF60011A099 /* Upload.swift in Sources */, - 4CF627111BA7CBF60011A099 /* Stream.swift in Sources */, + 4C574E6C1C67D207000B3128 /* Timeline.swift in Sources */, + 4CFCFE301D56D31700A76388 /* SessionDelegate.swift in Sources */, 4CF6270C1BA7CBF60011A099 /* Result.swift in Sources */, - 4CF627081BA7CBF60011A099 /* Error.swift in Sources */, + 4CF627081BA7CBF60011A099 /* AFError.swift in Sources */, 4CF627131BA7CBF60011A099 /* Validation.swift in Sources */, 4CF6270E1BA7CBF60011A099 /* MultipartFormData.swift in Sources */, 4C80F9F81BB730EF001B46D2 /* Response.swift in Sources */, - 4CF627091BA7CBF60011A099 /* Manager.swift in Sources */, + 4CB9282B1C66BFBC00CE5F08 /* Notifications.swift in Sources */, + 4CF627091BA7CBF60011A099 /* SessionManager.swift in Sources */, 4CF6270F1BA7CBF60011A099 /* ResponseSerialization.swift in Sources */, 4CF6270B1BA7CBF60011A099 /* Request.swift in Sources */, + 4C43669D1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */, + 4C3D00561C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */, + 4CFCFE3B1D56E8D900A76388 /* TaskDelegate.swift in Sources */, 4CF6270A1BA7CBF60011A099 /* ParameterEncoding.swift in Sources */, 4CF627101BA7CBF60011A099 /* ServerTrustPolicy.swift in Sources */, - 4CF6270D1BA7CBF60011A099 /* Download.swift in Sources */, 4CF627071BA7CBF60011A099 /* Alamofire.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -935,9 +1168,12 @@ 4CF627181BA7CC240011A099 /* RequestTests.swift in Sources */, 4CF627211BA7CC240011A099 /* TLSEvaluationTests.swift in Sources */, 4CF627221BA7CC240011A099 /* UploadTests.swift in Sources */, + 4C9DCE7A1CB1BCE2003E6463 /* SessionDelegateTests.swift in Sources */, 4C80F9F91BB730F6001B46D2 /* String+AlamofireTests.swift in Sources */, 4CF6271E1BA7CC240011A099 /* MultipartFormDataTests.swift in Sources */, + 31ED52EA1D73891C00199085 /* AFError+AlamofireTests.swift in Sources */, 4CF627201BA7CC240011A099 /* ServerTrustPolicyTests.swift in Sources */, + 4CFB02921D7CF28F0056F249 /* FileManager+AlamofireTests.swift in Sources */, 4CF627241BA7CC240011A099 /* ValidationTests.swift in Sources */, 4CF627141BA7CC240011A099 /* BaseTestCase.swift in Sources */, 4CF627151BA7CC240011A099 /* AuthenticationTests.swift in Sources */, @@ -945,9 +1181,9 @@ 4CF627191BA7CC240011A099 /* ResponseTests.swift in Sources */, 4CF627231BA7CC240011A099 /* URLProtocolTests.swift in Sources */, 4CF6271C1BA7CC240011A099 /* CacheTests.swift in Sources */, - 4CF627161BA7CC240011A099 /* ManagerTests.swift in Sources */, + 4CF627161BA7CC240011A099 /* SessionManagerTests.swift in Sources */, 4CF6271A1BA7CC240011A099 /* ResultTests.swift in Sources */, - 4CF6271B1BA7CC240011A099 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */, + 4C3D005A1C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */, 4CF6271F1BA7CC240011A099 /* ResponseSerializationTests.swift in Sources */, 4CF6271D1BA7CC240011A099 /* DownloadTests.swift in Sources */, ); @@ -957,18 +1193,21 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 4CDE2C411AF89E0700BABAE5 /* Upload.swift in Sources */, + 4C574E6B1C67D207000B3128 /* Timeline.swift in Sources */, + 4CFCFE2F1D56D31700A76388 /* SessionDelegate.swift in Sources */, 4CE272501AF88FB500F1D59A /* ParameterEncoding.swift in Sources */, 4CDE2C3B1AF899EC00BABAE5 /* Request.swift in Sources */, 4CDE2C471AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */, - 4C1DC8551B68908E00476DE3 /* Error.swift in Sources */, - 4CDE2C381AF8932A00BABAE5 /* Manager.swift in Sources */, + 4C1DC8551B68908E00476DE3 /* AFError.swift in Sources */, + 4CDE2C381AF8932A00BABAE5 /* SessionManager.swift in Sources */, 4C0B62521BB1001C009302D3 /* Response.swift in Sources */, + 4CB9282A1C66BFBC00CE5F08 /* Notifications.swift in Sources */, 4DD67C251A5C590000ED2280 /* Alamofire.swift in Sources */, 4C23EB441B327C5B0090E0BC /* MultipartFormData.swift in Sources */, + 4C43669C1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */, 4C811F8E1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */, - 4C83F41C1B749E0E00203445 /* Stream.swift in Sources */, - 4CDE2C3E1AF89D4900BABAE5 /* Download.swift in Sources */, + 4CFCFE3A1D56E8D900A76388 /* TaskDelegate.swift in Sources */, + 4C3D00551C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */, 4CDE2C441AF89F0900BABAE5 /* Validation.swift in Sources */, 4C0E5BF91B673D3400816CCC /* Result.swift in Sources */, ); @@ -978,19 +1217,22 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - E4202FCF1B667AA100C997FB /* Upload.swift in Sources */, + 4C574E6D1C67D207000B3128 /* Timeline.swift in Sources */, + 4CEE82AD1C6813CF00E9C9F0 /* NetworkReachabilityManager.swift in Sources */, + 4CFCFE311D56D31700A76388 /* SessionDelegate.swift in Sources */, E4202FD01B667AA100C997FB /* ParameterEncoding.swift in Sources */, E4202FD11B667AA100C997FB /* Request.swift in Sources */, - 4CEC605A1B745C9100E684F4 /* Error.swift in Sources */, + 4CEC605A1B745C9100E684F4 /* AFError.swift in Sources */, E4202FD21B667AA100C997FB /* ResponseSerialization.swift in Sources */, - E4202FD31B667AA100C997FB /* Manager.swift in Sources */, + E4202FD31B667AA100C997FB /* SessionManager.swift in Sources */, 4C0B62531BB1001C009302D3 /* Response.swift in Sources */, + 4CB9282C1C66BFBC00CE5F08 /* Notifications.swift in Sources */, 4CEC605B1B745C9100E684F4 /* Result.swift in Sources */, + 4C43669E1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */, E4202FD41B667AA100C997FB /* Alamofire.swift in Sources */, + 4CFCFE3C1D56E8D900A76388 /* TaskDelegate.swift in Sources */, E4202FD51B667AA100C997FB /* MultipartFormData.swift in Sources */, - 4C83F41D1B749E0E00203445 /* Stream.swift in Sources */, E4202FD61B667AA100C997FB /* ServerTrustPolicy.swift in Sources */, - E4202FD71B667AA100C997FB /* Download.swift in Sources */, E4202FD81B667AA100C997FB /* Validation.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -999,19 +1241,22 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 4CDE2C401AF89E0700BABAE5 /* Upload.swift in Sources */, + 4C574E6A1C67D207000B3128 /* Timeline.swift in Sources */, + 4CFCFE2E1D56D31700A76388 /* SessionDelegate.swift in Sources */, 4CE2724F1AF88FB500F1D59A /* ParameterEncoding.swift in Sources */, 4CDE2C3A1AF899EC00BABAE5 /* Request.swift in Sources */, 4CDE2C461AF89FF300BABAE5 /* ResponseSerialization.swift in Sources */, - 4C1DC8541B68908E00476DE3 /* Error.swift in Sources */, - 4CDE2C371AF8932A00BABAE5 /* Manager.swift in Sources */, + 4C1DC8541B68908E00476DE3 /* AFError.swift in Sources */, + 4CDE2C371AF8932A00BABAE5 /* SessionManager.swift in Sources */, 4C0B62511BB1001C009302D3 /* Response.swift in Sources */, F897FF4119AA800700AB5182 /* Alamofire.swift in Sources */, 4C23EB431B327C5B0090E0BC /* MultipartFormData.swift in Sources */, 4C811F8D1B51856D00E0F59A /* ServerTrustPolicy.swift in Sources */, - 4C83F41B1B749E0E00203445 /* Stream.swift in Sources */, - 4CDE2C3D1AF89D4900BABAE5 /* Download.swift in Sources */, + 4C43669B1D7BB93D00C38AAD /* DispatchQueue+Alamofire.swift in Sources */, + 4C3D00541C66A63000D1F709 /* NetworkReachabilityManager.swift in Sources */, + 4CFCFE391D56E8D900A76388 /* TaskDelegate.swift in Sources */, 4CDE2C431AF89F0900BABAE5 /* Validation.swift in Sources */, + 4CB928291C66BFBC00CE5F08 /* Notifications.swift in Sources */, 4C0E5BF81B673D3400816CCC /* Result.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1023,21 +1268,24 @@ 4C3238E71B3604DB00FE04AE /* MultipartFormDataTests.swift in Sources */, 4C33A1431B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */, 4C341BBA1B1A865A00C1B34D /* CacheTests.swift in Sources */, + 4C9DCE781CB1BCE2003E6463 /* SessionDelegateTests.swift in Sources */, 4C4CBE7B1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */, 4CA028C51B7466C500C84163 /* ResultTests.swift in Sources */, + 31ED52E81D73891B00199085 /* AFError+AlamofireTests.swift in Sources */, 4CCFA79A1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */, + 4CFB02901D7CF28F0056F249 /* FileManager+AlamofireTests.swift in Sources */, F86AEFE71AE6A312007D9C76 /* TLSEvaluationTests.swift in Sources */, 4C0B58391B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */, F8858DDD19A96B4300F55F93 /* RequestTests.swift in Sources */, 4C256A531B096C770065714F /* BaseTestCase.swift in Sources */, F8E6024519CB46A800A3E7F1 /* AuthenticationTests.swift in Sources */, F8858DDE19A96B4400F55F93 /* ResponseTests.swift in Sources */, - F8D1C6F519D52968002E74FE /* ManagerTests.swift in Sources */, + F8D1C6F519D52968002E74FE /* SessionManagerTests.swift in Sources */, F8AE910219D28DCC0078C7B2 /* ValidationTests.swift in Sources */, F8111E6119A9674D0040E7D1 /* ParameterEncodingTests.swift in Sources */, F8111E6419A9674D0040E7D1 /* UploadTests.swift in Sources */, + 4C3D00581C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */, F8111E6019A9674D0040E7D1 /* DownloadTests.swift in Sources */, - 4C7C8D221B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1048,21 +1296,24 @@ 4C3238E81B3604DB00FE04AE /* MultipartFormDataTests.swift in Sources */, 4C33A1441B52089C00873DFF /* ServerTrustPolicyTests.swift in Sources */, 4C341BBB1B1A865A00C1B34D /* CacheTests.swift in Sources */, + 4C9DCE791CB1BCE2003E6463 /* SessionDelegateTests.swift in Sources */, 4C4CBE7C1BAF700C0024D659 /* String+AlamofireTests.swift in Sources */, 4CA028C61B7466C500C84163 /* ResultTests.swift in Sources */, + 31ED52E91D73891C00199085 /* AFError+AlamofireTests.swift in Sources */, 4CCFA79B1B2BE71600B6F460 /* URLProtocolTests.swift in Sources */, + 4CFB02911D7CF28F0056F249 /* FileManager+AlamofireTests.swift in Sources */, F829C6BE1A7A950600A2CD59 /* ParameterEncodingTests.swift in Sources */, 4C0B583A1B747A4400C0B99C /* ResponseSerializationTests.swift in Sources */, F829C6BF1A7A950600A2CD59 /* RequestTests.swift in Sources */, 4C256A541B096C770065714F /* BaseTestCase.swift in Sources */, - F829C6C01A7A950600A2CD59 /* ManagerTests.swift in Sources */, + F829C6C01A7A950600A2CD59 /* SessionManagerTests.swift in Sources */, F829C6C11A7A950600A2CD59 /* ResponseTests.swift in Sources */, F829C6C21A7A950600A2CD59 /* UploadTests.swift in Sources */, F829C6C31A7A950600A2CD59 /* DownloadTests.swift in Sources */, F829C6C41A7A950600A2CD59 /* AuthenticationTests.swift in Sources */, F829C6C51A7A950600A2CD59 /* ValidationTests.swift in Sources */, + 4C3D00591C66A8B900D1F709 /* NetworkReachabilityManagerTests.swift in Sources */, F86AEFE81AE6A315007D9C76 /* TLSEvaluationTests.swift in Sources */, - 4C7C8D231B9D0D9000948136 /* NSURLSessionConfiguration+AlamofireTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1081,106 +1332,100 @@ }; F829C6BA1A7A94F100A2CD59 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 4DD67C0A1A5C55C900ED2280 /* Alamofire OSX */; + target = 4DD67C0A1A5C55C900ED2280 /* Alamofire macOS */; targetProxy = F829C6B91A7A94F100A2CD59 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ + 4CCB207D1D45563900C64D5B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 4CCB207E1D45563900C64D5B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; 4CF627001BA7CB3E0011A099 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "Source/Info-tvOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; + PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; }; 4CF627011BA7CB3E0011A099 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; - GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = "Source/Info-tvOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; + PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; }; 4CF627021BA7CB3E0011A099 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - DEBUG_INFORMATION_FORMAT = dwarf; + APPLICATION_EXTENSION_API_ONLY = NO; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.Alamofire-tvOSTests"; + PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.Alamofire-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; }; 4CF627031BA7CB3E0011A099 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=appletvsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + APPLICATION_EXTENSION_API_ONLY = NO; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.Alamofire-tvOSTests"; + PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.Alamofire-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; }; 4DD67C1F1A5C55C900ED2280 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1191,10 +1436,8 @@ ); INFOPLIST_FILE = Source/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -1204,23 +1447,19 @@ 4DD67C201A5C55C900ED2280 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; FRAMEWORK_VERSION = A; INFOPLIST_FILE = Source/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; SDKROOT = macosx; SKIP_INSTALL = YES; @@ -1230,13 +1469,8 @@ E4202FDE1B667AA100C997FB /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchsimulator*]" = ""; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; @@ -1246,11 +1480,10 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULE_NAME = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; + PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; SDKROOT = watchos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = 4; }; name = Debug; @@ -1258,23 +1491,18 @@ E4202FDF1B667AA100C997FB /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=watchsimulator*]" = ""; - COPY_PHASE_STRIP = NO; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; GCC_NO_COMMON_BLOCKS = YES; INFOPLIST_FILE = Source/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MODULE_NAME = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.Alamofire; + PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; SDKROOT = watchos; SKIP_INSTALL = YES; @@ -1286,6 +1514,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -1295,17 +1524,21 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", @@ -1319,11 +1552,12 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; @@ -1336,6 +1570,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + APPLICATION_EXTENSION_API_ONLY = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -1345,16 +1580,20 @@ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = YES; CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -1362,9 +1601,11 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; @@ -1377,65 +1618,52 @@ F8111E4719A95C8B0040E7D1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Source/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; F8111E4819A95C8B0040E7D1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_TESTABILITY = YES; INFOPLIST_FILE = Source/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = org.alamofire.Alamofire; PRODUCT_NAME = Alamofire; SKIP_INSTALL = YES; - SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; }; name = Release; }; F8111E4A19A95C8B0040E7D1 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; + APPLICATION_EXTENSION_API_ONLY = NO; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Debug; @@ -1443,13 +1671,12 @@ F8111E4B19A95C8B0040E7D1 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_IDENTITY = "iPhone Developer"; - "CODE_SIGN_IDENTITY[sdk=iphonesimulator*]" = ""; + APPLICATION_EXTENSION_API_ONLY = NO; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = "$(inherited)"; INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; }; name = Release; @@ -1457,6 +1684,7 @@ F829C6BC1A7A94F100A2CD59 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -1468,10 +1696,8 @@ "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; @@ -1480,18 +1706,16 @@ F829C6BD1A7A94F100A2CD59 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = NO; CODE_SIGN_IDENTITY = ""; COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(DEVELOPER_FRAMEWORKS_DIR)", "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.alamofire.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; }; @@ -1500,6 +1724,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 4CCB207F1D45563900C64D5B /* Build configuration list for PBXAggregateTarget "Cleanup Whitespace" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4CCB207D1D45563900C64D5B /* Debug */, + 4CCB207E1D45563900C64D5B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 4CF627041BA7CB3E0011A099 /* Build configuration list for PBXNativeTarget "Alamofire tvOS" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1518,7 +1751,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 4DD67C1E1A5C55C900ED2280 /* Build configuration list for PBXNativeTarget "Alamofire OSX" */ = { + 4DD67C1E1A5C55C900ED2280 /* Build configuration list for PBXNativeTarget "Alamofire macOS" */ = { isa = XCConfigurationList; buildConfigurations = ( 4DD67C1F1A5C55C900ED2280 /* Debug */, @@ -1563,7 +1796,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - F829C6BB1A7A94F100A2CD59 /* Build configuration list for PBXNativeTarget "Alamofire OSX Tests" */ = { + F829C6BB1A7A94F100A2CD59 /* Build configuration list for PBXNativeTarget "Alamofire macOS Tests" */ = { isa = XCConfigurationList; buildConfigurations = ( F829C6BC1A7A94F100A2CD59 /* Debug */, diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/project.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme old mode 100644 new mode 100755 index f3822a8..e19922d --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire iOS.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "NO"> + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -85,6 +84,13 @@ ReferencedContainer = "container:Alamofire.xcodeproj"> + + + + diff --git a/Chapter8/Chapter8-3/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire macOS.xcscheme old mode 100644 new mode 100755 similarity index 86% rename from Chapter8/Chapter8-3/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme rename to Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire macOS.xcscheme index 7568cea..f4265d3 --- a/Chapter8/Chapter8-3/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire OSX.xcscheme +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire macOS.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "NO"> @@ -40,16 +40,15 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "YES" - codeCoverageEnabled = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -59,7 +58,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "4DD67C0A1A5C55C900ED2280" BuildableName = "Alamofire.framework" - BlueprintName = "Alamofire OSX" + BlueprintName = "Alamofire macOS" ReferencedContainer = "container:Alamofire.xcodeproj"> @@ -81,7 +80,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "4DD67C0A1A5C55C900ED2280" BuildableName = "Alamofire.framework" - BlueprintName = "Alamofire OSX" + BlueprintName = "Alamofire macOS" ReferencedContainer = "container:Alamofire.xcodeproj"> @@ -99,7 +98,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "4DD67C0A1A5C55C900ED2280" BuildableName = "Alamofire.framework" - BlueprintName = "Alamofire OSX" + BlueprintName = "Alamofire macOS" ReferencedContainer = "container:Alamofire.xcodeproj"> diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme old mode 100644 new mode 100755 index 1c66ce8..f9486b7 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire tvOS.xcscheme @@ -1,6 +1,6 @@ + buildForAnalyzing = "NO"> + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -85,6 +84,13 @@ ReferencedContainer = "container:Alamofire.xcodeproj"> + + + + diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme old mode 100644 new mode 100755 index 9f7c434..d3ad179 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Alamofire watchOS.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Cleanup Whitespace.xcscheme b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Cleanup Whitespace.xcscheme new file mode 100755 index 0000000..180a97e --- /dev/null +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcodeproj/xcshareddata/xcschemes/Cleanup Whitespace.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcworkspace/contents.xcworkspacedata b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcworkspace/contents.xcworkspacedata old mode 100644 new mode 100755 index aa824c4..748f4a0 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcworkspace/contents.xcworkspacedata +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Alamofire.xcworkspace/contents.xcworkspacedata @@ -5,6 +5,6 @@ location = "group:Alamofire.xcodeproj"> + location = "group:Example/iOS Example.xcodeproj"> diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/CHANGELOG.md b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/CHANGELOG.md old mode 100644 new mode 100755 index d09fd7a..51da7fa --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/CHANGELOG.md +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/CHANGELOG.md @@ -2,8 +2,18 @@ All notable changes to this project will be documented in this file. `Alamofire` adheres to [Semantic Versioning](http://semver.org/). +#### 4.x Releases +- `4.2.x` Releases - [4.2.0](#420) +- `4.1.x` Releases - [4.1.0](#410) +- `4.0.x` Releases - [4.0.0](#400) | [4.0.1](#401) +- `4.0.0` Betas - [4.0.0-beta.1](#400-beta1) | [4.0.0-beta.2](#400-beta2) + #### 3.x Releases -- `3.1.x` Releases - [3.1.0](#310) | [3.1.1](#311) | [3.1.2](#312) | [3.1.3](#313) +- `3.5.x` Releases - [3.5.0](#350) | [3.5.1](#351) +- `3.4.x` Releases - [3.4.0](#340) | [3.4.1](#341) | [3.4.2](#342) +- `3.3.x` Releases - [3.3.0](#330) | [3.3.1](#331) +- `3.2.x` Releases - [3.2.0](#320) | [3.2.1](#321) +- `3.1.x` Releases - [3.1.0](#310) | [3.1.1](#311) | [3.1.2](#312) | [3.1.3](#313) | [3.1.4](#314) | [3.1.5](#315) - `3.0.x` Releases - [3.0.0](#300) | [3.0.1](#301) - `3.0.0` Betas - [3.0.0-beta.1](#300-beta1) | [3.0.0-beta.2](#300-beta2) | [3.0.0-beta.3](#300-beta3) @@ -19,6 +29,765 @@ All notable changes to this project will be documented in this file. --- +## [4.2.0](https://github.com/Alamofire/Alamofire/releases/tag/4.2.0) +Released on 2016-11-20. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A4.2.0). + +#### Added +- Request property overrides to fallback on original task if available. + - Added by [Aron Cedercrantz](https://github.com/rastersize) in Pull Request + [#1792](https://github.com/Alamofire/Alamofire/pull/1792). +- `Timeline` generation to `DefaultDataResponse` and `DefaultDownloadResponse`. + - Added by [Christian Noon](https://github.com/cnoon). +- JSON encoding `encode` method that takes a JSON object along with unit tests. + - Added by [Christian Noon](https://github.com/cnoon). + +#### Updated +- The `RequestRetrier` example in the README to safely extract tokens. + - Updated by [Pontus Andersson](https://github.com/pontus-andersson) in Pull Request + [#1794](https://github.com/Alamofire/Alamofire/pull/1794). +- `TaskDelegate` `data` and `error` properties to a `public` ACL. + - Updated by [Christian Noon](https://github.com/cnoon). +- Multipart form data uploads to now delete temp file if encoding fails. + - Updated by [Christian Noon](https://github.com/cnoon). + +#### Fixed +- Issue where `AdaptError` instances were being incorrectly sent to the `RequestRetrier`. + - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1785](https://github.com/Alamofire/Alamofire/issues/1785). +- Issue where TLS tests were failing on iOS 10.0 and not on iOS 10.1. + - Fixed by [Christian Noon](https://github.com/cnoon). + +--- + +## [4.1.0](https://github.com/Alamofire/Alamofire/releases/tag/4.1.0) +Released on 2016-11-15. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A4.1.0). + +#### Added +- Docstrings and a note to the README about `resumeData` and background session behavior. + - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1553](https://github.com/Alamofire/Alamofire/issues/1553). +- Request `retryCount` property to support the `RequestRetrier`. + - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1672](https://github.com/Alamofire/Alamofire/issues/1672). + +#### Updated +- SPM package file to exclude tests since current configuration is not supported. + - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1544](https://github.com/Alamofire/Alamofire/issues/1544). +- An example in the README to use proper error checking in download response handler. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#1722](https://github.com/Alamofire/Alamofire/pull/1722). +- Embedded framework installation instructions. + - Updated by [ILI4S K4RIM](https://github.com/ILI4S) in Pull Request + [#1721](https://github.com/Alamofire/Alamofire/pull/1721). +- The AF4 Migration Guide to no longer use `DispatchQueue` internal APIs in the example. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#1736](https://github.com/Alamofire/Alamofire/pull/1736). +- The `RequestAdapter` to call the `RequestRetrier` when an `Error` is thrown. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1682](https://github.com/Alamofire/Alamofire/pull/1682). +- The `SessionManager` to clean up the temporary multipart form data file after upload. + - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1742](https://github.com/Alamofire/Alamofire/issues/1742). +- The deployment targets to **iOS 8.0** and **macOS 10.10**. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1774](https://github.com/Alamofire/Alamofire/pull/1774). +- The Travis CI yaml file to support iOS 8 simulators. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1774](https://github.com/Alamofire/Alamofire/pull/1774). +- The iOS Example app deployment target to iOS 8.0. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1774](https://github.com/Alamofire/Alamofire/pull/1774). + +#### Removed +- Duplicate auto-code signing on macOS. + - Removed by [Christian Noon](https://github.com/cnoon) +- Duplicate code signing identities on various targets. + - Removed by [Christian Noon](https://github.com/cnoon) + +#### Fixed +- A compiler error in response validation sample code in the README. + - Fixed by [Vishrut Shah](https://github.com/vishrutshah) in Pull Request + [#1615](https://github.com/Alamofire/Alamofire/pull/1615). +- Several internal `SessionManager` links that were broken in the README. + - Fixed by [Vishrut Shah](https://github.com/vishrutshah) in Pull Request + [#1625](https://github.com/Alamofire/Alamofire/pull/1625). +- Issue in the sample code of the README where `response.error` was used incorrectly. + - Fixed by [Bob](https://github.com/bot2600) in Pull Request + [#1633](https://github.com/Alamofire/Alamofire/pull/1633). +- Issue in the `ServerTrustPolicy` tests where a `macOS 10.12` check was needed. + - Fixed by [Jon Shier](https://github.com/jshier). +- Compiler issue with `DownloadRequest` in AF4 Migration Guide. + - Fixed by [Wolfgang Lutz](https://github.com/Lutzifer) in Pull Request + [#1670](https://github.com/Alamofire/Alamofire/pull/1670). +- Test target compiler warning by not requiring app extension APIs only. + - Fixed by [Christian Noon](https://github.com/cnoon). +- Typo in the HTTP Headers section of the README. + - Fixed by [Carlos McEvilly](https://github.com/carlosmcevilly) in Pull Request + [#1734](https://github.com/Alamofire/Alamofire/pull/1734). +- Incorrect response type in the response README examples. + - Fixed by [Julien Chaumond](https://github.com/julien-c) in Pull Request + [#1760](https://github.com/Alamofire/Alamofire/pull/1760). +- Xcode 8.1 compiler warnings and project suggestions. + - Fixed by [Jon Shier](https://github.com/jshier) in Pull Request + [#1735](https://github.com/Alamofire/Alamofire/pull/1735). +- Issue where download completion could crash on a `nil` response. + - Fixed by [Jon Shier](https://github.com/jshier) in Pull Request + [#1723](https://github.com/Alamofire/Alamofire/pull/1723). +- Issue in TLS tests where root certificate was missing from server trust. + - Fixed by [Christian Noon](https://github.com/cnoon). + +--- + +## [4.0.1](https://github.com/Alamofire/Alamofire/releases/tag/4.0.1) +Released on 2016-09-24. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A4.0.1). + +#### Added +- The `OS_ACTIVITY_MODE` environment variable to iOS, tvOS and iOS Example. + - Added by [Christian Noon](https://github.com/cnoon). +- Test verifying download request can be resumed with resume data. + - Added by [Christian Noon](https://github.com/cnoon). + +#### Updated +- All instances of `com.alamofire` with `org.alamofire` throughout the project. + - Updated by [Christian Noon](https://github.com/cnoon). +- Project by adding `.swift-version` file and re-enabling `pod lib lint` in Travis file. + - Updated by [Thibault Vlacich](https://github.com/ThibaultVlacich) in Pull Request + [#1534](https://github.com/Alamofire/Alamofire/pull/1534). +- The entire project to use `macOS` in place of `OS X`. + - Updated by [Justin Jia](https://github.com/JustinJiaDev) in Pull Request + [#1520](https://github.com/Alamofire/Alamofire/pull/1520). +- Framework and test target override settings that duplicated the project settings. + - Updated by [Christian Noon](https://github.com/cnoon). + +#### Fixed +- Issue where the test suite was accidentally deleting contents of `~/Library/Application Support` + on macOS. + - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1512](https://github.com/Alamofire/Alamofire/issues/1512). +- Typo in the migration guide around availability checks. + - Fixed by [Alexsander Akers](https://github.com/a2) in Pull Request + [#1510](https://github.com/Alamofire/Alamofire/pull/1510). +- Typo in the README around response handlers. + - Fixed by [Glenn R. Fisher](https://github.com/glennrfisher) in Pull Request + [#1515](https://github.com/Alamofire/Alamofire/pull/1515). +- Issue in the download example in the README where a `to` parameter was missing. + - Fixed by [Julien Colin](https://github.com/Toldy) in Pull Request + [#1532](https://github.com/Alamofire/Alamofire/pull/1532). +- Issue in `AFError` where wrong case was used in several property implementations. + - Fixed by [Victor Chee](https://github.com/victorchee) in Pull Request + [#1558](https://github.com/Alamofire/Alamofire/pull/1558). +- Typo in AF 4 migration guide where "enhancements" was spelled incorrectly. + - Fixed by [YeralYamil](https://github.com/YeralYamil) in Pull Request + [#1590](https://github.com/Alamofire/Alamofire/pull/1590). +- Typo in code sample documentation where "already" was misspelled. + - Fixed by [Fuad Kamal](https://github.com/abunur) in Pull Request + [#1599](https://github.com/Alamofire/Alamofire/pull/1599). +- Typos in the Open Radars and Donations sections of README. + - Fixed by [Brian Lu](https://github.com/bakemecookies) in Pull Request + [#1606](https://github.com/Alamofire/Alamofire/pull/1606). +- Issue in `DispatchQueue` extension where `Foundation` needed to be imported for submodules. + - Fixed by [CodeEagle](https://github.com/CodeEagle) in Pull Request + [#1603](https://github.com/Alamofire/Alamofire/pull/1603). +- Memory leak in `Validation` closures where reference to `self` was causing retain cycle. + - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1551](https://github.com/Alamofire/Alamofire/issues/1551). +- Compilation issue in response handler section of the README. + - Fixed by [Vishrut Shah](https://github.com/vishrutshah) in Pull Request + [#1612](https://github.com/Alamofire/Alamofire/pull/1612). + +## [4.0.0](https://github.com/Alamofire/Alamofire/releases/tag/4.0.0) +Released on 2016-09-11. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A4.0.0). + +#### Added +- Internal `DispatchQueue` extension set of convenience properties and methods. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1450](https://github.com/Alamofire/Alamofire/pull/1450). +- `RequestAdapter` and `RequestRetrier` protocols allowing requests to be retried. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1450](https://github.com/Alamofire/Alamofire/pull/1450). +- `RequestAdapter` tests on all testable `SessionManager` request APIs. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1450](https://github.com/Alamofire/Alamofire/pull/1450). +- Added an `Adapting and Retrying Requests` section to the README. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1450](https://github.com/Alamofire/Alamofire/pull/1450). +- `DataRequest`, `DownloadRequest`, `UploadRequest` and `StreamRequest` subclasses. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1455](https://github.com/Alamofire/Alamofire/pull/1455). +- Top-level APIs for creating `StreamRequest` instances. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1455](https://github.com/Alamofire/Alamofire/pull/1455). +- Extra `responseToSelector` overrides for stream delegate APIs. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1455](https://github.com/Alamofire/Alamofire/pull/1455). +- A new `syncResult` extension to `DispatchQueue` to simplify thread-safe locking. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1455](https://github.com/Alamofire/Alamofire/pull/1455). +- Two serialization failure reasons to support download response serializers. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1457](https://github.com/Alamofire/Alamofire/pull/1457). +- Download response serialization tests for all serializer types. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1457](https://github.com/Alamofire/Alamofire/pull/1457). +- The `dataFileNil` and `dataFileReadFailed` cases to `ResponseValidationFailureReason`. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1461](https://github.com/Alamofire/Alamofire/pull/1461). +- The `isWildcard` property to MIMEType struct for convenience. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1461](https://github.com/Alamofire/Alamofire/pull/1461). +- Missing `CustomDebugStringCovertible` conformance to `DownloadResponse`. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1462](https://github.com/Alamofire/Alamofire/pull/1462). +- URL variants to the `FileManager` extension in the test suite. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1462](https://github.com/Alamofire/Alamofire/pull/1462). +- `DownloadOptions` option set to make moving files more robust. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1462](https://github.com/Alamofire/Alamofire/pull/1462). +- Tests validating success and failure scenarios for `DownloadOptions`. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1462](https://github.com/Alamofire/Alamofire/pull/1462). +- Parameter encoding failure docstrings and refactored reasons to be consistent. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1465](https://github.com/Alamofire/Alamofire/pull/1465). +- Safeguards to url parameter encoding when extracting the url request’s url. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1465](https://github.com/Alamofire/Alamofire/pull/1465). +- The new `URLSessionTaskMetrics` to all `Response types`. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1492](https://github.com/Alamofire/Alamofire/pull/1492). +- The Alamofire 4.0 Migration Guide to the README. + - Added by [Christian Noon](https://github.com/cnoon). +- `HTTPHeaders` typealias for top-level API convenience. + - Added by [Christian Noon](https://github.com/cnoon). +- Complete safeguards to `URLStringConvertible`, `URLRequestConvertible` and `RequestAdapter`. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1505](https://github.com/Alamofire/Alamofire/pull/1505). +- Tests around invalidURL error cases for `Request` creation and adaptation. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1505](https://github.com/Alamofire/Alamofire/pull/1505). + +#### Updated +- The `authorizationHeader` static method over to returning optional tuple. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1455](https://github.com/Alamofire/Alamofire/pull/1455). +- `SessionManager` queues to each have a unique name using a UUID suffix. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1455](https://github.com/Alamofire/Alamofire/pull/1455). +- The progress tracking system across all `Request` subclasses to improve accuracy. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1455](https://github.com/Alamofire/Alamofire/pull/1455). +- `BaseTestCase` to delete contents of common directories at the start of each test. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1457](https://github.com/Alamofire/Alamofire/pull/1457). +- Response handler extensions by moving them into `DataRequest` and added equivalents + for `DownloadRequest`. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1457](https://github.com/Alamofire/Alamofire/pull/1457). +- The response serializer types to use the `Protocol` suffix. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1457](https://github.com/Alamofire/Alamofire/pull/1457). +- `Validation` typealias to include response data in a `DataRequest` type. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1461](https://github.com/Alamofire/Alamofire/pull/1461). +- `Validation` typealias to include temporary and destination URLs in a `DownloadRequest` type. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1461](https://github.com/Alamofire/Alamofire/pull/1461). +- `SessionManager` APIs to all leverage `TaskConvertible` conformance. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1461](https://github.com/Alamofire/Alamofire/pull/1461). +- `DownloadFileDestination` closures to be optional on top-level `DownloadRequest` APIs. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1462](https://github.com/Alamofire/Alamofire/pull/1462). +- The `request` and `download` APIs now default to `.get` method and `upload` defaults to `.post`. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1462](https://github.com/Alamofire/Alamofire/pull/1462). +- The `ParameterEncoding` encode API to throw instead of returning tuple. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1465](https://github.com/Alamofire/Alamofire/pull/1465). +- The `TaskDelegate` to only store the url session task error if `error` is `nil`. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1465](https://github.com/Alamofire/Alamofire/pull/1465). +- `ParameterEncoding` enum by switching to a protocol backed by url, json and plist structs. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1465](https://github.com/Alamofire/Alamofire/pull/1465). +- Updated RequestRetrier completion to be escaping. + - Updated by [Aron Cedercrantz](https://github.com/rastersize) in Pull Request + [#1489](https://github.com/Alamofire/Alamofire/pull/1489). +- Code signing to automatic with no team on framework, test and app targets. + - Updated by [Christian Noon](https://github.com/cnoon). +- README for Swift 3 and Alamofire 4 along with reorganization. + - Updated by [Christian Noon](https://github.com/cnoon). +- README with improved `Error` examples as well as typo and whitespace fixes. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#1504](https://github.com/Alamofire/Alamofire/pull/1504). +- `Request` task property is now optional allowing errors to propagate through. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1505](https://github.com/Alamofire/Alamofire/pull/1505). +- The Travis-CI device list in the yaml file. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1505](https://github.com/Alamofire/Alamofire/pull/1505). +- The top-level APIs by removing external `resource` parameter name. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1505](https://github.com/Alamofire/Alamofire/pull/1505). +- The `URLStringCovertible` by renaming to `URLConvertible` and removed protocol property. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1505](https://github.com/Alamofire/Alamofire/pull/1505). +- The README and migration guide with the `URLConvertible` and top-level API changes. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1505](https://github.com/Alamofire/Alamofire/pull/1505). + +#### Removed +- Unnecessary `public` ACL declarations on `AFError` extensions. + - Removed by [Christian Noon](https://github.com/cnoon). +- `URLStringConvertible` conformance on `URLRequest`. + - Removed by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1491](https://github.com/Alamofire/Alamofire/pull/1491). +- Removed `downloadProgress` and `uploadProgress` Int64 variants. + - Removed by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1467](https://github.com/Alamofire/Alamofire/issues/1467) reported by + [thebluepotato](https://github.com/thebluepotato). +- Duplicated change log message in the migration guide. + - Removed by [Justin Jia](https://github.com/JustinJiaDev) in Pull Request + [#1503](https://github.com/Alamofire/Alamofire/pull/1503). +- Code coverage generation by default to improve test suite stability. + - Removed by [Christian Noon](https://github.com/cnoon). + +#### Fixed +- Fixed `URLEncoding` issue around `NSNumber` parameter encoding. + - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1458](https://github.com/Alamofire/Alamofire/issues/1458) reported by + [Dhanush Balachandran](https://github.com/dhanushram). +- Issue where `MultipartFormData` temp directory creation needed to be done serially. + - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1333](https://github.com/Alamofire/Alamofire/issues/1333) reported by + [Fernando Mazzon](https://github.com/fer662). +- Issue in resume data tests where request was being cancelled multiple times. + - Fixed by [Christian Noon](https://github.com/cnoon). + +--- + +## [4.0.0-beta.2](https://github.com/Alamofire/Alamofire/releases/tag/4.0.0-beta.2) +Released on 2016-08-29. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A4.0.0-beta.2). + +#### Fixed +- Build issue with `Manager` class due to cherry picked change that merged incorrectly. + - Fixed by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1438](https://github.com/Alamofire/Alamofire/pull/1438). + +## [4.0.0-beta.1](https://github.com/Alamofire/Alamofire/releases/tag/4.0.0-beta.1) +Released on 2016-08-28. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A4.0.0-beta.1). + +#### Added +- `discardableResult` annotations to all top-level Request APIs. + - Added by [Christian Noon](https://github.com/cnoon). + +#### Updated +- All source, test and example logic as well as project settings to compile against + the Xcode 8 beta releases. + - Updated by [Kevin Harwood](https://github.com/kcharwood), + [Jon Shier](https://github.com/jshier) and + [Christian Noon](https://github.com/cnoon). +- Deployment targets to iOS 9.0, macOS 10.11, tvOS 9.0 and watchOS 2.0. + - Updated by [Christian Noon](https://github.com/cnoon). +- Notifications to use nested structs inside `Notification.Name` namespace. + - Updated by [Christian Noon](https://github.com/cnoon). +- The `Manager` class to `SessionManager` to be more descriptive. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1385](https://github.com/Alamofire/Alamofire/pull/1385). +- The `SessionDelegate`, `TaskDelegate` and subclasses by pulling them into the global namespace. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1385](https://github.com/Alamofire/Alamofire/pull/1385). +- All the Core APIs and documentation to match Swift 3 API design guidelines. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1385](https://github.com/Alamofire/Alamofire/pull/1385). +- The `SessionDelegate` to store `Request` instances internally to prepare for retry logic. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1391](https://github.com/Alamofire/Alamofire/pull/1391). +- The podspec to 4.0.0-beta.1 and bumped the deployment targets. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#1401](https://github.com/Alamofire/Alamofire/pull/1401). +- The parameter order of custom `URLRequest` initializer to match other APIs. + - Updated by [Christian Noon](https://github.com/cnoon). +- The travis yaml file for Xcode 8. + - Updated by [Christian Noon](https://github.com/cnoon). +- The `Error` enum to `AFError` which now conforms to the new `Error` protocol. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#1419](https://github.com/Alamofire/Alamofire/pull/1419). + +#### Fixed +- Typo in a parameter name in the `MultipartFormData` Swift 3 API refactor. + - Fixed by [Joshua Hudson](https://github.com/jhudsonWA) in Pull Request + [#1395](https://github.com/Alamofire/Alamofire/pull/1395). + +#### Upgrade Notes +This release requires Xcode 8.0 beta 6+ because it has been completely refactored to compile against Swift 3.0. Any older versions of Xcode will **NOT COMPILE**. + +This release is the start of the Alamofire 4.0.0 beta releases. We still have quite a few large changes we're trying to squeeze in before the Xcode 8 GM drops, so the APIs will continue to change over the next few weeks. Please keep in mind that each beta will likely bring new APIs and also refactor others. The betas **WILL NOT** follow semantic versioning. We'll most likely conform to semantic versioning once we start releasing the RCs unless we run into a major unforeseen issue. + +We'd really appreciate everyone trying out the betas and letting us know if you find issues. We want to address every possible issue prior to the official Alamofire 4.0.0 release. + +--- + +## [3.5.1](https://github.com/Alamofire/Alamofire/releases/tag/3.5.1) +Released on 2016-10-01. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.5.1). + +#### Fixed +- Assorted memory leaks caused by underlying Swift runtime bugs. + - Fixed by [Jon Shier](https://github.com/jshier) in regards to Issue + [#1626](https://github.com/Alamofire/Alamofire/issues/1626). +- Issue in the test suite logic on macOS 10.12. + - Fixed by [Jon Shier](https://github.com/jshier). + +## [3.5.0](https://github.com/Alamofire/Alamofire/releases/tag/3.5.0) +Released on 2016-09-07. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.5.0). + +#### Updated +- The `User-Agent` header generation formatting and also added docs and tests. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#1456](https://github.com/Alamofire/Alamofire/pull/1456) in regards to Issue + [#1452](https://github.com/Alamofire/Alamofire/issues/1452). +- All source, test and example logic as well as project settings to compile against + Xcode 7 and 8 against Swift 2.2 or 2.3 respectively. + - Updated by [Kevin Harwood](https://github.com/kcharwood), + [Jon Shier](https://github.com/jshier) and + [Christian Noon](https://github.com/cnoon). +- The Travis CI yaml file to support both Xcode 7.3 and 8 simultaneously. + - Updated by [Christian Noon](https://github.com/cnoon). + +#### Fixed +- A TLS evaluation test that could fail with a different error when behind a proxy. + - Fixed by [Christian Noon](https://github.com/cnoon). + +--- + +## [3.4.2](https://github.com/Alamofire/Alamofire/releases/tag/3.4.2) +Released on 2016-08-28. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.4.2). + +#### Added +- Added Cleanup Whitespace target to remove excess whitespace from Swift files. + - Added by [Christian Noon](https://github.com/cnoon). + +#### Updated +- All TLS evaluation tests from `disig.sk` to `badssl.com` to be more reliant and robust. + - Updated by [Christian Noon](https://github.com/cnoon). +- Internal `URLRequest` method to maintain mutable variant data on an `NSURLRequest` passed + into the top-level APIs. + - Updated by [Greedwolf DSS](https://github.com/passchaos) in Pull Request + [#1330](https://github.com/Alamofire/Alamofire/pull/1330). +- The `User-Agent` header to include version and build numbers. + - Updated by [Sergey Demchenko](https://github.com/antrix1989) in Pull Request + [#1420](https://github.com/Alamofire/Alamofire/pull/1420). + +#### Removed +- All excess whitespace from Swift files using the `Cleanup Whitespace` target. + - Removed by [Christian Noon](https://github.com/cnoon). + +#### Fixed +- `Request` debug description tests to no longer require parameters in a specific order. + - Fixed by [Marius Serban](https://github.com/marius-serban) in Pull Request + [#1318](https://github.com/Alamofire/Alamofire/pull/1318). +- Small ACL issue in code sample of the Handling Errors section of the README. + - Fixed by [Adrian Brink](https://github.com/adrianbrink) in Pull Request + [#1315](https://github.com/Alamofire/Alamofire/pull/1315). + +## [3.4.1](https://github.com/Alamofire/Alamofire/releases/tag/3.4.1) +Released on 2016-06-12. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.4.1). + +#### Added +- Rdar `26761490` to the list of rdars affecting Alamofire. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1262](https://github.com/Alamofire/Alamofire/pull/1262). +- A new `debugDescription` test for a MultipartFormData Request with duplicate headers. + - Added by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1303](https://github.com/Alamofire/Alamofire/issues/1303). + +#### Updated +- CocoaPod installation instructions in README to be compatible with 1.x. + - Updated by [Luis Ferro](https://github.com/lferro9000) in Pull Request + [#1288](https://github.com/Alamofire/Alamofire/pull/1288). +- The README to reflect the best error practices in response serializers. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#1273](https://github.com/Alamofire/Alamofire/pull/1273). +- The generation of the `User-Agent` header to use non-localized sources. + - Updated by [Jon Shier](https://github.com/jshier) in Pull Request + [#1292](https://github.com/Alamofire/Alamofire/pull/1292) in regards to Issue + [#1269](https://github.com/Alamofire/Alamofire/pull/1269). +- The `Generic Response Object Serialization` section of the README to use protocol extension. + - Updated by [Raphael Oliveira](https://github.com/raphaeloliveira) in Pull Request + [#1257](https://github.com/Alamofire/Alamofire/pull/1257). +- Reachability by removing explicit IPv6 logic since OS handles this automatically. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1308](https://github.com/Alamofire/Alamofire/pull/1308) in regards to Issue + [#1228](https://github.com/Alamofire/Alamofire/pull/1228). +- Host manager reachability test to use different hostname to improve test reliability. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1308](https://github.com/Alamofire/Alamofire/pull/1308). + +#### Removed +- `ReleaseTest` configuration and updated Travis-CI yaml file to enable testability directly. + - Removed by [Christian Noon](https://github.com/cnoon). + +#### Fixed +- Memory leak in `Timeline` description and debugDescription due to string interpolation. + - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1262](https://github.com/Alamofire/Alamofire/issues/1262) in regards to Issue + [#1232](https://github.com/Alamofire/Alamofire/issues/1232). + +## [3.4.0](https://github.com/Alamofire/Alamofire/releases/tag/3.4.0) +Released on 2016-05-08. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.4.0). + +#### Added +- Status code and content type values into validation `NSError` userInfo dictionaries. + - Added by [Cédric Luthi](https://github.com/0xced) in Pull Request + [#1166](https://github.com/Alamofire/Alamofire/pull/1166). +- New `authorizationHeader` API to generate base64 encoded authorization header. + - Added by [Cédric Luthi](https://github.com/0xced) in Pull Request + [#1187](https://github.com/Alamofire/Alamofire/pull/1187). + +#### Updated +- URLProtocol tests to demonstrate using `NSURLProtocol` with `NSURLSession`. + - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1160](https://github.com/Alamofire/Alamofire/issues/1160). +- The `SesionDelegate` to no longer be `final` to allow subclassing. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1172](https://github.com/Alamofire/Alamofire/issues/1172) in regards to Issue + [#1145](https://github.com/Alamofire/Alamofire/issues/1145). +- The `SessionDelegate` subscript public to allow full control when subclassing. + - Updated by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1172](https://github.com/Alamofire/Alamofire/issues/1172). +- The `Response Serialization` section of the README to include validation examples. + - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1213](https://github.com/Alamofire/Alamofire/issues/1213). +- The delegate guard in the `Manager` initializer in front of property assignment. + - Updated by [Broccoliii](https://github.com/broccolii) in Pull Request + [#1226](https://github.com/Alamofire/Alamofire/issues/1226). +- Header example in the README to use `Accept` header instead of `Content-Type`. + - Updated by [Christian Noon](https://github.com/cnoon) in regards to Pull Request + [#1229](https://github.com/Alamofire/Alamofire/issues/1229). + +#### Deprecated +- The `errorWithCode` APIs and updated NSURLError* domains to `NSURLErrorDomain`. + - Deprecated by [Cédric Luthi](https://github.com/0xced) in Pull Request + [#1166](https://github.com/Alamofire/Alamofire/pull/1166). + +#### Fixed +- Issue where Requests with invalid credentials were not terminating with 401 status code. + - Fixed by [Cédric Luthi](https://github.com/0xced) in Pull Request + [#1164](https://github.com/Alamofire/Alamofire/pull/1164) in regards to Issue + [#1159](https://github.com/Alamofire/Alamofire/issues/1159). +- Issue in URLProtocol test where config headers are not passed prior to iOS 9.0. + - Fixed by [Christian Noon](https://github.com/cnoon). +- Issue where Request `cURLRepresentation` method was not coalescing duplicate headers. + - Fixed by [Chris Richards](https://github.com/chrisrichards) in Pull Request + [#1186](https://github.com/Alamofire/Alamofire/pull/1186) in regards to Issue + [#1184](https://github.com/Alamofire/Alamofire/issues/1184). +- Issue where incorrect dash in License file was breaking markdown parsing. + - Fixed by [Gemma Barlow](https://github.com/gemmakbarlow) in Pull Request + [#1218](https://github.com/Alamofire/Alamofire/issues/1218). +- Issue where internal quotes were not escaped correctly in cURL output. + - Fixed by [Christian Noon](https://github.com/cnoon). + +--- + +## [3.3.1](https://github.com/Alamofire/Alamofire/releases/tag/3.3.1) +Released on 2016-04-06. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.3.1). + +#### Added +- Tests for the `SessionDelegate` redirect with completion override closure. + - Added by [Kevin Harwood](https://github.com/kcharwood) in Pull Request + [#1141](https://github.com/Alamofire/Alamofire/issues/1141). +- Tests for all the `SessionDelegate` override closures. + - Added by [Christian Noon](https://github.com/cnoon). + +#### Updated +- The authentication test cases to clear out all cookies to help stabilize Travis-CI. + - Updated by [Christian Noon](https://github.com/cnoon). +- The cache test check for no store header to use availability checks. + - Updated by [Christian Noon](https://github.com/cnoon). + +#### Fixed +- The `respondsToSelector` check for the new HTTP redirect closure with completion. + - Fixed by [Kevin Harwood](https://github.com/kcharwood) in Pull Request + [#1141](https://github.com/Alamofire/Alamofire/issues/1141) in regards to Issue + [#1140](https://github.com/Alamofire/Alamofire/issues/1140). +- Issue where the challenge and response `SessionDelegate` override closures were not called. + - Fixed by [Christian Noon](https://github.com/cnoon). +- Typo in the Travis YAML file that was causing all tests to always fail on iOS 9.1. + - Fixed by [Christian Noon](https://github.com/cnoon). +- Race condition in the cache tests that was causing random failures on Travis-CI. + - Fixed by [Christian Noon](https://github.com/cnoon). + +## [3.3.0](https://github.com/Alamofire/Alamofire/releases/tag/3.3.0) +Released on 2016-03-23. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.3.0). + +#### Added +- Added override closures for all `SessionDelegate` APIs with completion handlers. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1099](https://github.com/Alamofire/Alamofire/pull/1099). + +#### Updated +- The `User-Agent` header implementation to use more aggresive type-safety checks. + - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1100](https://github.com/Alamofire/Alamofire/issues/1100). +- All shared response serializers to accept a custom queue for execution. + - Updated by [Luca Torella](https://github.com/lucatorella) in Pull Request + [#1112](https://github.com/Alamofire/Alamofire/pull/1112). +- The network reachability manager to use IPv4 on iOS 8.x and OSX 10.9.x. + - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issue + [#1086](https://github.com/Alamofire/Alamofire/issues/1086). +- All source, test and example code to compile against Swift 2.2. + - Updated by [James Barrow](https://github.com/Baza207) and [Dominik Hadl](https://github.com/nickskull) in Pull Requests + [#1030](https://github.com/Alamofire/Alamofire/pull/1030) and + [#1128](https://github.com/Alamofire/Alamofire/pull/1128). +- The Travis CI YAML file to use Xcode 7.3 and also updated matrix targets. + - Updated by [Christian Noon](https://github.com/cnoon). + +#### Fixed +- Issue in JSON response serialization test case where the wrong serializer was being tested. + - Fixed by [Gregory J.H. Rho](https://github.com/topchul) in Pull Request + [#1108](https://github.com/Alamofire/Alamofire/pull/1108). +- Issue where multipart form data encoding was unnecessarily scheduling input and output + streams with the current runloop. + - Fixed by [Brian King](https://github.com/KingOfBrian) in Pull Request + [#1121](https://github.com/Alamofire/Alamofire/pull/1121). + +#### Upgrade Notes +This release requires Xcode 7.3+ otherwise the Swift 2.2 changes will **NOT COMPILE**. There are several reasons why this was deployed as a MINOR and not MAJOR release. First off, the public API changes of this release are fully backwards compatible. There are no breaking API changes in the public APIs. Strictly following semver dictates that this is a MINOR, not MAJOR release. + +> See [semver](http://semver.org/#semantic-versioning-specification-semver) for more info. + +We also realize that this can be frustrating for those out there not ready to upgrade to Xcode 7.3. Please know that we consider each release version carefully before deploying. Our decision to bump the MINOR version was not only due to strictly following semver, but also because it's difficult and undesirable for all OSS libraries to bump MAJOR versions each time the Swift APIs are incremented. Alamofire would have had to go through 6 additional MAJOR versions if this was the policy. That would mean we'd already be running on Alamofire 10.x. Incrementing MAJOR versions this quickly is disruptive to the community and would cause even more confusion. Instead, we try to carefully plan our MAJOR version releases and accompany them with detailed Migration Guides to help make the transition as smooth as possible. + +If anyone has additional questions, please feel free to open an issue and we'll be more than happy to discuss further. + +--- + +## [3.2.1](https://github.com/Alamofire/Alamofire/releases/tag/3.2.1) +Released on 2016-02-27. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.2.1). + +#### Updated +- `StringResponseSerializer` implementation to build with the latest Swift toolchain. + - Updated by [Chris Cieslak](https://github.com/vivid-cieslak) in Pull Request + [#1050](https://github.com/Alamofire/Alamofire/pull/1050). +- Expanded the Component Libraries section and moved it up in the README. + - Updated by [Christian Noon](https://github.com/cnoon). + +#### Fixed +- Issue where JSON and plist custom content types were not retained during parameter encoding. + - Fixed by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1088](https://github.com/Alamofire/Alamofire/pull/1088). + +## [3.2.0](https://github.com/Alamofire/Alamofire/releases/tag/3.2.0) +Released on 2016-02-07. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.2.0). + +#### Added +- Notifications that post when an `NSURLSessionTask` changes state to allow support for the + network activity indicator. + - Added by [Christian Noon](https://github.com/cnoon). +- `Timeline` struct to capture timings throughout the lifecycle of a `Request`. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1054](https://github.com/Alamofire/Alamofire/issues/1054). +- A new `Timeline` section to the README. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1054](https://github.com/Alamofire/Alamofire/issues/1054). +- `NetworkReachabilityManager` to listen for reachability status changes. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1053](https://github.com/Alamofire/Alamofire/issues/1053). +- Unit tests for all the testable network reachability manager APIs. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1053](https://github.com/Alamofire/Alamofire/issues/1053). +- A new `Network Reachability` section to the README. + - Added by [Christian Noon](https://github.com/cnoon) in Pull Request + [#1053](https://github.com/Alamofire/Alamofire/issues/1053). + +#### Updated +- The `NSURLSessionStream` APIs to support `tvOS`. + - Updated by [Christian Noon](https://github.com/cnoon). +- The `ParameterEncoding` encode method to allow empty parameters to still be encoded. + - Updated by [Christian Noon](https://github.com/cnoon) in regards to Issues + [#1032](https://github.com/Alamofire/Alamofire/issues/1032) and + [#1049](https://github.com/Alamofire/Alamofire/issues/1049). + +#### Fixed +- Broken CocoaDocs generation by moving iOS Example project into Examples folder. + - Fixed by [Jon Shier](https://github.com/jshier) in Pull Request + [#1027](https://github.com/Alamofire/Alamofire/issues/1027) in regards to Issue + [#1025](https://github.com/Alamofire/Alamofire/issues/1025). + +--- + +## [3.1.5](https://github.com/Alamofire/Alamofire/releases/tag/3.1.5) +Released on 2016-01-17. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.5). + +#### Added +- `Package.swift` to the project to support Swift Package Manager (SPM). + - Added by [Kyle Fuller](https://github.com/kylef) in Pull Request + [#979](https://github.com/Alamofire/Alamofire/pull/979). +- Safeguards to the `Request` class's `debugDescription` property. + - Added by [tokorom](https://github.com/tokorom) in Pull Request + [#983](https://github.com/Alamofire/Alamofire/pull/983). + +#### Updated +- `Accept-Language` header generation to use functional style. + - Updated by [Dapeng Gao](https://github.com/dapenggao) in Pull Request + [#982](https://github.com/Alamofire/Alamofire/pull/982). +- `Accept-Encoding` and `Accept-Language` header values to have separator spaces between values. + - Updated by [Christian Noon](https://github.com/cnoon). +- Copyright headers to include 2016! 🎉🎉🎉 + - Updated by [Christian Noon](https://github.com/cnoon). + +## [3.1.4](https://github.com/Alamofire/Alamofire/releases/tag/3.1.4) +Released on 2015-12-16. All issues associated with this milestone can be found using this +[filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.4). + +#### Added +- `NSTemporaryExceptionMinimumTLSVersion` documentation to the ATS section in the README. + - Added by [Marandon Antoine](https://github.com/ntnmrndn) in Pull Request + [#952](https://github.com/Alamofire/Alamofire/pull/952). +- Added `ReleaseTest` configuration to allow running tests against optimized build. + - Added by [Christian Noon](https://github.com/cnoon). + +#### Updated +- Carthage instructions in the README to clearly callout the `carthage update` command. + - Updated by [vlad](https://github.com/vlastachu) in Pull Request + [#955](https://github.com/Alamofire/Alamofire/pull/955). +- `ParameterEncoding` to early out when passed an empty parameters dictionary. + - Updated by [Anthony Miller](https://github.com/AnthonyMDev) in Pull Request + [#954](https://github.com/Alamofire/Alamofire/pull/954). +- The `certificatesInBundle` to support `cer`, `crt` and `der` extensions. + - Updated by [Jacob Jennings](https://github.com/jacobjennings) in Pull Request + [#956](https://github.com/Alamofire/Alamofire/pull/956). +- The `ENABLE_TESTABILITY` flag to `NO` for Release configuration and disabled tests for + non-test builds to better support Carthage. + - Updated by [Jed Lewison](https://github.com/jedlewison) in Pull Request + [#953](https://github.com/Alamofire/Alamofire/pull/953). +- The server certificates for the TLS tests and added all certificates to all test targets. + - Updated by [Christian Noon](https://github.com/cnoon). +- The Travis-CI configuration to Xcode 7.2, iOS 9.2, tvOS 9.1 and watchOS 2.1. + - Updated by [Christian Noon](https://github.com/cnoon). + +#### Removed +- `SecCertificate` array Swift workaround in `ServerTrustPolicy` for Xcode 7.2. + - Removed by [Christian Noon](https://github.com/cnoon). + ## [3.1.3](https://github.com/Alamofire/Alamofire/releases/tag/3.1.3) Released on 2015-11-22. All issues associated with this milestone can be found using this [filter](https://github.com/Alamofire/Alamofire/issues?utf8=✓&q=milestone%3A3.1.3). diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/CONTRIBUTING.md b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/CONTRIBUTING.md old mode 100644 new mode 100755 index 5de3be7..6e3e930 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/CONTRIBUTING.md +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/CONTRIBUTING.md @@ -45,7 +45,7 @@ Doing this helps prioritize the most common problems and requests. When reporting issues, please include the following: * The version of Xcode you're using -* The version of iOS or OS X you're targeting +* The version of iOS or macOS you're targeting * The full output of any stack trace or compiler error * A code snippet that reproduces the described behavior, if applicable * Any other details that would be useful in understanding the problem diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Documentation/Alamofire 2.0 Migration Guide.md b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Documentation/Alamofire 2.0 Migration Guide.md old mode 100644 new mode 100755 diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Documentation/Alamofire 3.0 Migration Guide.md b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Documentation/Alamofire 3.0 Migration Guide.md old mode 100644 new mode 100755 diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Documentation/Alamofire 4.0 Migration Guide.md b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Documentation/Alamofire 4.0 Migration Guide.md new file mode 100755 index 0000000..6a175ec --- /dev/null +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Documentation/Alamofire 4.0 Migration Guide.md @@ -0,0 +1,930 @@ +# Alamofire 4.0 Migration Guide + +Alamofire 4.0 is the latest major release of Alamofire, an HTTP networking library for iOS, tvOS, macOS and watchOS written in Swift. As a major release, following Semantic Versioning conventions, 4.0 introduces API-breaking changes. + +This guide is provided in order to ease the transition of existing applications using Alamofire 3.x to the latest APIs, as well as explain the design and structure of new and updated functionality. + +- [Requirements](#requirements) +- [Benefits of Upgrading](#benefits-of-upgrading) +- [Breaking API Changes](#breaking-api-changes) + - [Namespace Changes](#namespace-changes) + - [Making Requests](#making-requests) + - [URLStringConvertible](#urlstringconvertible) + - [URLRequestConvertible](#urlrequestconvertible) +- [New Features](#new-features) + - [Request Adapter](#request-adapter) + - [Request Retrier](#request-retrier) + - [Task Metrics](#task-metrics) +- [Updated Features](#updated-features) + - [Errors](#errors) + - [Parameter Encoding Protocol](#parameter-encoding-protocol) + - [Request Subclasses](#request-subclasses) + - [Response Validation](#response-validation) + - [Response Serializers](#response-serializers) + +## Requirements + +- iOS 8.0+, macOS 10.10.0+, tvOS 9.0+ and watchOS 2.0+ +- Xcode 8.1+ +- Swift 3.0+ + +For those of you that would like to use Alamofire on iOS 8 or macOS 10.9, please use the latest tagged 3.x release which supports both Swift 2.2 and 2.3. + +## Benefits of Upgrading + +- **Complete Swift 3 Compatibility:** includes the full adoption of the new [API Design Guidelines](https://swift.org/documentation/api-design-guidelines/). +- **New Error System:** uses a new `AFError` type to adhere to the new pattern proposed in [SE-0112](https://github.com/apple/swift-evolution/blob/master/proposals/0112-nserror-bridging.md). +- **New RequestAdapter Protocol:** allows inspection and adaptation of every `URLRequest` before instantiating a `Request` allowing for easy modification of properties like the `Authorization` header. +- **New RequestRetrier Protocol:** allows you to inspect and retry any failed `Request` if necessary allowing you to build custom authentication solutions (OAuth1, OAuth2, xAuth, Basic Auth, etc.) around a set of requests. +- **New Parameter Encoding Protocol:** replaces the `ParameterEncoding` enumeration allowing for easier extension and customization and also throws errors on failure instead of returning a tuple. +- **New Request Types:** include `DataRequest`, `DownloadRequest`, `UploadRequest` and `StreamRequest` that implement specialized progress, validation and serialization APIs and behaviors per `Request` type. +- **New Progress APIs:** include `downloadProgress` and `uploadProgress` APIs supporting both `Progress` and `Int64` types and called on a specified dispatch queue defaulting to `.main`. +- **Enhanced Response Validation:** now includes the `data` or `temporaryURL` and `destinationURL` allowing inline closures to parse the server data for error messages if validation failed. +- **New Download Destinations:** allow you to have full control over the move operation on the file system by disabling it, removing a previous file and creating intermediate directories. +- **New Response Types:** unify response API signatures and expose `temporaryURL` and `downloadURL` properties for downloads and the all new task metrics on newer platforms. + +--- + +## Breaking API Changes + +Alamofire 4 has fully adopted all the new Swift 3 changes and conventions, including the new [API Design Guidelines](https://swift.org/documentation/api-design-guidelines/). Because of this, almost every API in Alamofire has been modified in some way. We can't possibly document every single change, so we're going to attempt to identify the most common APIs and how they have changed to help you through those sometimes less than helpful compiler errors. + +### Namespace Changes + +Some of the common classes have been moved into the global namespace to make them a bit easier to work with and to make them first class types. + +- `Manager` is now `SessionManager` +- `Request.TaskDelegate` is now `TaskDelegate` +- `Request.DataTaskDelegate` is now `DataTaskDelegate` +- `Request.DownloadTaskDelegate` is now `DownloadTaskDelegate` +- `Request.UploadTaskDelegate` is now `UploadTaskDelegate` + +We've also reorganized the file structure and organization patterns significantly to make it easier to follow the code. We hope that this will encourage more users to get to know the internal structure and implementation of Alamofire. Knowledge is power. + +### Making Requests + +Since making requests is certainly the most common operation in Alamofire, here are some examples of Alamofire 3.x requests compared to their new equivalents in Alamofire 4. + +#### Data Request - Simple with URL string + +```swift +// Alamofire 3 +Alamofire.request(.GET, urlString).response { request, response, data, error in + print(request) + print(response) + print(data) + print(error) +} + +// Alamofire 4 +Alamofire.request(urlString).response { response in // method defaults to `.get` + debugPrint(response) +} +``` + +#### Data Request - Complex with URL string + +```swift +// Alamofire 3 +let parameters: [String: AnyObject] = ["foo": "bar"] + +Alamofire.request(.GET, urlString, parameters: parameters, encoding: .JSON) + .progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in + print("Bytes: \(bytesRead), Total Bytes: \(totalBytesRead), Total Bytes Expected: \(totalBytesExpectedToRead)") + } + .validate { request, response in + // Custom evaluation closure (no access to server data) + return .success + } + .responseJSON { response in + debugPrint(response) + } + +// Alamofire 4 +let parameters: Parameters = ["foo": "bar"] + +Alamofire.request(urlString, method: .get, parameters: parameters, encoding: JSONEncoding.default) + .downloadProgress(queue: DispatchQueue.global(qos: .utility)) { progress in + print("Progress: \(progress.fractionCompleted)") + } + .validate { request, response, data in + // Custom evaluation closure now includes data (allows you to parse data to dig out error messages if necessary) + return .success + } + .responseJSON { response in + debugPrint(response) + } +``` + +#### Download Request - Simple with URL string + +```swift +// Alamofire 3 +let destination = DownloadRequest.suggestedDownloadDestination() + +Alamofire.download(.GET, urlString, destination: destination).response { request, response, data, error in + // What is fileURL...not easy to get + print(request) + print(response) + print(data) + print(error) +} + +// Alamofire 4 +let destination = DownloadRequest.suggestedDownloadDestination() + +Alamofire.download(urlString, to: destination).response { response in // method defaults to `.get` + print(response.request) + print(response.response) + print(response.temporaryURL) + print(response.destinationURL) + print(response.error) +} +``` + +#### Download Request - Simple with URL request + +```swift +// Alamofire 3 +let destination = DownloadRequest.suggestedDownloadDestination() + +Alamofire.download(urlRequest, destination: destination).validate().responseData { response in + // What is fileURL...not easy to get + debugPrint(response) +} + +// Alamofire 4 +Alamofire.download(urlRequest, to: destination).validate().responseData { response in + debugPrint(response) + print(response.temporaryURL) + print(response.destinationURL) +} +``` + +#### Download Request - Complex with URL string + +```swift +// Alamofire 3 +let fileURL: NSURL +let destination: Request.DownloadFileDestination = { _, _ in fileURL } +let parameters: [String: AnyObject] = ["foo": "bar"] + +Alamofire.download(.GET, urlString, parameters: parameters, encoding: .JSON, to: destination) + .progress { bytesRead, totalBytesRead, totalBytesExpectedToRead in + print("Bytes: \(bytesRead), Total Bytes: \(totalBytesRead), Total Bytes Expected: \(totalBytesExpectedToRead)") + } + .validate { request, response in + // Custom evaluation implementation (no access to temporary or destination URLs) + return .success + } + .responseJSON { response in + print(fileURL) // Only accessible if captured in closure scope, not ideal + debugPrint(response) + } + +// Alamofire 4 +let fileURL: URL +let destination: DownloadRequest.DownloadFileDestination = { _, _ in + return (fileURL, [.createIntermediateDirectories, .removePreviousFile]) +} +let parameters: Parameters = ["foo": "bar"] + +Alamofire.download(urlString, method: .get, parameters: parameters, encoding: JSONEncoding.default, to: destination) + .downloadProgress(queue: DispatchQueue.global(qos: .utility)) { progress in + print("Progress: \(progress.fractionCompleted)") + } + .validate { request, response, temporaryURL, destinationURL in + // Custom evaluation closure now includes file URLs (allows you to parse out error messages if necessary) + return .success + } + .responseJSON { response in + debugPrint(response) + print(response.temporaryURL) + print(response.destinationURL) + } +``` + +#### Upload Request - Simple with URL string + +```swift +// Alamofire 3 +Alamofire.upload(.POST, urlString, data: data).response { request, response, data, error in + print(request) + print(response) + print(data) + print(error) +} + +// Alamofire 4 +Alamofire.upload(data, to: urlString).response { response in // method defaults to `.post` + debugPrint(response) +} +``` + +#### Upload Request - Simple with URL request + +```swift +// Alamofire 3 +Alamofire.upload(urlRequest, file: fileURL).validate().responseData { response in + debugPrint(response) +} + +// Alamofire 4 +Alamofire.upload(fileURL, with: urlRequest).validate().responseData { response in + debugPrint(response) +} +``` + +#### Upload Request - Complex with URL string + +```swift +// Alamofire 3 +Alamofire.upload(.PUT, urlString, file: fileURL) + .progress { bytes, totalBytes, totalBytesExpected in + // Are these for upload or for downloading the response? + print("Bytes: \(bytesRead), Total Bytes: \(totalBytesRead), Total Bytes Expected: \(totalBytesExpectedToRead)") + } + .validate { request, response in + // Custom evaluation implementation (no access to server data) + return .success + } + .responseJSON { response in + debugPrint(response) + } + +// Alamofire 4 +Alamofire.upload(fileURL, to: urlString, method: .put) + .uploadProgress(queue: DispatchQueue.global(qos: .utility)) { progress in + print("Upload Progress: \(progress.fractionCompleted)") + } + .downloadProgress { progress in // called on main queue by default + print("Download Progress: \(progress.fractionCompleted)") + } + .validate { request, response, data in + // Custom evaluation closure now includes data (allows you to parse data to dig out error messages if necessary) + return .success + } + .responseJSON { response in + debugPrint(response) + } +``` + +As you can see, there are many breaking API changes, but the common APIs still adhere to the original design goals of being able to make complex requests through a single line of code in a concise, well defined manner. + +### URLStringConvertible + +There are two changes to the `URLStringConvertible` protocol that are worth noting. + +#### URLConvertible + +The first MAJOR change worth noting on the `URLStringConvertible` is that it has been renamed to `URLConvertible`. In Alamofire 3.x, the `URLStringConvertible` was defined as: + +```swift +public protocol URLStringConvertible { + var URLString: String { get } +} +``` + +Now in Alamofire 4, the `URLConvertible` protocol is defined as: + +```swift +public protocol URLConvertible { + func asURL() throws -> URL +} +``` + +As you can see, the `URLString` property is completely gone and replaced by a new `asURL` method that throws. To explain, let's first backup. + +A VERY common problem in Alamofire is that users forget to percent escape their URL strings and Alamofire will crash. Up until now, we (the Alamofire team) have taken the stance that this is how Alamofire is designed and your URLs need to conform to [RFC 2396](https://tools.ietf.org/html/rfc2396). This is certainly not ideal for the community because we all would rather have Alamofire tell us that our URL was invalid rather than having it crash. + +Now, back to the new `URLConvertible` protocol. The reason Alamofire was not previously able to safely handle invalid URL strings was, in fact, due to the lack of safety on `URLStringConvertible`. It's not possible for Alamofire to know how to intelligently make an invalid URL string valid. Therefore, if the `URL` is unable to be created from the `URLConvertible`, an `AFError.invalidURL` error is thrown. + +This change (along with many others) allows Alamofire to safely handle invalid URLs and report the error back in the response handlers. + +#### URLRequest Conformance + +The `URLRequest` no longer conforms to the `URLStringConvertible`, now `URLConvertible` protocol. This was always a bit of a stretch in the previous versions of Alamofire and wasn't really necessary. It also had a high potential to introduce ambiguity into many Alamofire APIs. Because of these reasons, `URLRequest` no longer conforms to `URLStringConvertible` (now `URLConvertible`). + +What this means in code is that you can no longer do the following: + +```swift +let urlRequest = URLRequest(url: URL(string: "https://httpbin.org/get")!) +let urlString = urlRequest.urlString +``` + +Instead, in Alamofire 4, you now have to do the following: + +```swift +let urlRequest = URLRequest(url: URL(string: "https://httpbin.org/get")!) +let urlString = urlRequest.url?.absoluteString +``` + +> See [PR-1505](https://github.com/Alamofire/Alamofire/pull/1505) for more info. + +### URLRequestConvertible + +The `URLRequestConvertible` was susceptible to the same safety issues concerns as the `URLStringConvertible` in Alamofire 3.x. In Alamofire 3, the `URLRequestConvertible` was: + +```swift +public protocol URLRequestConvertible { + var URLRequest: URLRequest { get } +} +``` + +Now, in Alamofire 4, it is: + +```swift +public protocol URLRequestConvertible { + func asURLRequest() throws -> URLRequest +} +``` + +As you can see, the `URLRequest` property has been replaced by an `asURLRequest` method that throws when encountering an error generating the `URLRequest`. + +The most likely place this will affect your code is in the `Router` design pattern. If you have a `Router`, it's going to have to change, but for the better! You will now implement the `asURLRequest` method instead of the property which gives you the ability to throw an error if necessary. You no longer have to force unwrap unsafe data or parameters or wrap `ParameterEncoding` in a do-catch. Any error encountered in a `Router` can now be automatically handled by Alamofire. + +> See [PR-1505](https://github.com/Alamofire/Alamofire/pull/1505) for more info. + +--- + +## New Features + +### Request Adapter + +The `RequestAdapter` protocol is a completely new feature in Alamofire 4. + +```swift +public protocol RequestAdapter { + func adapt(_ urlRequest: URLRequest) throws -> URLRequest +} +``` + +It allows each `Request` made on a `SessionManager` to be inspected and adapted before being created. One very specific way to use an adapter is to append an `Authorization` header to requests behind a certain type of authentication. + +```swift +class AccessTokenAdapter: RequestAdapter { + private let accessToken: String + + init(accessToken: String) { + self.accessToken = accessToken + } + + func adapt(_ urlRequest: URLRequest) throws -> URLRequest { + var urlRequest = urlRequest + + if urlRequest.urlString.hasPrefix("https://httpbin.org") { + urlRequest.setValue("Bearer " + accessToken, forHTTPHeaderField: "Authorization") + } + + return urlRequest + } +} + +let sessionManager = SessionManager() +sessionManager.adapter = AccessTokenAdapter(accessToken: "1234") + +sessionManager.request("https://httpbin.org/get") +``` + +If an `Error` occurs during the adaptation process, it should be thrown and will be delivered in the response handler of the `Request`. + +> See [PR-1450](https://github.com/Alamofire/Alamofire/pull/1450) for more info. + +### Request Retrier + +The `RequestRetrier` is another brand new Alamofire 4 protocol. + +```swift +public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: TimeInterval) -> Void + +public protocol RequestRetrier { + func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) +} +``` + +It allows a `Request` that encountered an `Error` while being executed to be retried with an optional delay if specified. + +```swift +class OAuth2Handler: RequestAdapter, RequestRetrier { + public func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: RequestRetryCompletion) { + if let response = request.task.response as? HTTPURLResponse, response.statusCode == 401 { + completion(true, 1.0) // retry after 1 second + } else { + completion(false, 0.0) // don't retry + } + } +} + +let sessionManager = SessionManager() +sessionManager.retrier = OAuth2Handler() + +sessionManager.request(urlString).responseJSON { response in + debugPrint(response) +} +``` + +The retrier allows you to inspect the `Request` after it has completed and run all `Validation` closures to determine whether it should be retried. When using both the `RequestAdapter` and `RequestRetrier` protocols together, you can create credential refresh systems for OAuth1, OAuth2, Basic Auth and even exponential backoff retry policies. The possibilities are endless. For more information and examples on this topic, please refer to the README. + +> See [PR-1391](https://github.com/Alamofire/Alamofire/pull/1391) and [PR-1450](https://github.com/Alamofire/Alamofire/pull/1450) for more info. + +### Task Metrics + +In iOS and tvOS 10 and macOS 10.12, Apple introduced the new [URLSessionTaskMetrics](https://developer.apple.com/reference/foundation/urlsessiontaskmetrics) APIs. The task metrics encapsulate some fantastic statistical information about the request and response execution. The API is very similar to Alamofire's `Timeline`, but provide many more statistics that Alamofire was unable to compute. We're really excited about these APIs and have exposed them on each `Response` type meaning they couldn't be easier to use. + +```swift +Alamofire.request(urlString).response { response in + debugPrint(response.metrics) +} +``` + +It's important to note that these APIs are only available on iOS and tvOS 10+ and macOS 10.12+. Therefore, depending on your deployment target, you may need to use these inside availability checks: + +```swift +Alamofire.request(urlString).response { response in + if #available(iOS 10.0, *) { + debugPrint(response.metrics) + } +} +``` + +> See [PR-1492](https://github.com/Alamofire/Alamofire/pull/1492) for more info. + +--- + +## Updated Features + +Alamofire 4 contains many new features and enhancements on existing ones. This section is designed to give a brief overview of the features and demonstrate their uses. For more information on each each, please refer to the linked pull request. + +### Errors + +Alamofire 4 contains a completely new error system that adopts the new pattern proposed in [SE-0112](https://github.com/apple/swift-evolution/blob/master/proposals/0112-nserror-bridging.md). At the heart of the new error system is `AFError`, a new `Error` type enumeration backed by five main cases. + +- `.invalidURL(url: URLConvertible)` - Returned when a `URLConvertible` type fails to create a valid `URL`. +- `.parameterEncodingFailed(reason: ParameterEncodingFailureReason)` - Returned when a parameter encoding object throws an error during the encoding process. +- `.multipartEncodingFailed(reason: MultipartEncodingFailureReason)` - Returned when some step in the multipart encoding process fails. +- `.responseValidationFailed(reason: ResponseValidationFailureReason)` - Returned when a `validate()` call fails. +- `.responseSerializationFailed(reason: ResponseSerializationFailureReason)` - Returned when a response serializer encounters an error in the serialization process. + +Each case contains a specific failure reason which is another nested enumeration with multiple cases that contain additional information about the exact type of error that occurred. What this ultimately means is that is is much easier in Alamofire to identify where an error came from and what to do about it. + +```swift +Alamofire.request(urlString).responseJSON { response in + guard case let .failure(error) = response.result else { return } + + if let error = error as? AFError { + switch error { + case .invalidURL(let url): + print("Invalid URL: \(url) - \(error.localizedDescription)") + case .parameterEncodingFailed(let reason): + print("Parameter encoding failed: \(error.localizedDescription)") + print("Failure Reason: \(reason)") + case .multipartEncodingFailed(let reason): + print("Multipart encoding failed: \(error.localizedDescription)") + print("Failure Reason: \(reason)") + case .responseValidationFailed(let reason): + print("Response validation failed: \(error.localizedDescription)") + print("Failure Reason: \(reason)") + + switch reason { + case .dataFileNil, .dataFileReadFailed: + print("Downloaded file could not be read") + case .missingContentType(let acceptableContentTypes): + print("Content Type Missing: \(acceptableContentTypes)") + case .unacceptableContentType(let acceptableContentTypes, let responseContentType): + print("Response content type: \(responseContentType) was unacceptable: \(acceptableContentTypes)") + case .unacceptableStatusCode(let code): + print("Response status code was unacceptable: \(code)") + } + case .responseSerializationFailed(let reason): + print("Response serialization failed: \(error.localizedDescription)") + print("Failure Reason: \(reason)") + } + + print("Underlying error: \(error.underlyingError)") + } else if let error = error as? URLError { + print("URLError occurred: \(error)") + } else { + print("Unknown error: \(error)") + } +} +``` + +This new design allows you to drill down into errors as deep as you may need to in order to figure out the best way to proceed. It also frees developers from the burden of having to deal with `NSError` types everywhere. By switching to our own custom `Error` type in Alamofire, we've been able to simplify the `Result` and `Response` generic types to only require a single generic parameter. This simplifies the response serialization logic. + +> See [PR-1419](https://github.com/Alamofire/Alamofire/pull/1419) for more info. + +### Parameter Encoding Protocol + +The `ParameterEncoding` enumeration has served us well for over two years at this point. However, it had some limitations that we wanted to address in Alamofire 4. + +- The `.url` case has always been a bit confusing since it selects a destination based on the HTTP method. +- The `.urlEncodedInURL` case has always been an eye sore to work around the behavior of the `.url` case. +- `.JSON` and `.PropertyList` encoding could not accept formatting or writing options. +- The `.Custom` encoding was a bit difficult for users to get the hang of. + +Because of these reasons, we decided to eliminate the enumeration altogether in Alamofire 4! Now, `ParameterEncoding` is a protocol backed by three concrete `URLEncoding`, `JSONEncoding` and `PropertyList` encoding structs with a new `Parameters` typealias for creating your parameter dictionaries. + +```swift +public typealias Parameters = [String: Any] + +public protocol ParameterEncoding { + func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest +} +``` + +#### URL Encoding + +The new `URLEncoding` struct contains a `Destination` enumeration supporting three types of destinations: + +- `.methodDependent` - Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` requests and sets as the HTTP body for requests with any other HTTP method. +- `.queryString` - Sets or appends encoded query string result to existing query string. +- `.httpBody` - Sets encoded query string result as the HTTP body of the URL request. + +These destinations make it much easier to control where the parameters are encoded onto the `URLRequest`. Creating requests still uses the same signature as before in regards to parameter encoding and also has the same default behavior. + +```swift +let parameters: Parameters = ["foo": "bar"] + +Alamofire.request(urlString, parameters: parameters) // Encoding => URLEncoding(destination: .methodDependent) +Alamofire.request(urlString, parameters: parameters, encoding: URLEncoding(destination: .queryString)) +Alamofire.request(urlString, parameters: parameters, encoding: URLEncoding(destination: .httpBody)) + +// Static convenience properties (we'd like to encourage everyone to use this more concise form) +Alamofire.request(urlString, parameters: parameters, encoding: URLEncoding.default) +Alamofire.request(urlString, parameters: parameters, encoding: URLEncoding.queryString) +Alamofire.request(urlString, parameters: parameters, encoding: URLEncoding.httpBody) +``` + +#### JSON Encoding + +The new `JSONEncoding` struct exposes the ability to customize the JSON writing options. + +```swift +let parameters: Parameters = ["foo": "bar"] + +Alamofire.request(urlString, parameters: parameters, encoding: JSONEncoding(options: [])) +Alamofire.request(urlString, parameters: parameters, encoding: JSONEncoding(options: .prettyPrinted)) + +// Static convenience properties (we'd like to encourage everyone to use this more concise form) +Alamofire.request(urlString, parameters: parameters, encoding: JSONEncoding.default) +Alamofire.request(urlString, parameters: parameters, encoding: JSONEncoding.prettyPrinted) +``` + +#### Property List Encoding + +The new `PropertyListEncoding` struct allows customizing the plist format and write options. + +```swift +let parameters: Parameters = ["foo": "bar"] + +Alamofire.request(urlString, parameters: parameters, encoding: PropertyListEncoding(format: .xml, options: 0)) +Alamofire.request(urlString, parameters: parameters, encoding: PropertyListEncoding(format: .binary, options: 0)) + +// Static convenience properties (we'd like to encourage everyone to use this more concise form) +Alamofire.request(urlString, parameters: parameters, encoding: PropertyListEncoding.xml) +Alamofire.request(urlString, parameters: parameters, encoding: PropertyListEncoding.binary) +``` + +#### Custom Encoding + +Creating a custom custom `ParameterEncoding` is now as simple as implementing the protocol. For more examples on how to do this, please refer to the README. + +> See [PR-1465](https://github.com/Alamofire/Alamofire/pull/1465) for more info. + +### Request Subclasses + +In Alamofire 4, the `request`, `download`, `upload` and `stream` APIs no longer return a `Request`. Instead, they return a specific type of `Request` subclass. There were several motivating factors and community questions that led us to making this change: + +- **Progress:** The behavior of the `progress` method was confusing for upload requests. + - What does `progress` report on an upload `Request`? The progress of the upload? The progress of the response download? + - If it reports both, how do you know if or when it switches? +- **Response Serializers:** The response serializers were designed for data and upload requests, not download or stream requests. + - How do you access the fileURL when a download is complete? + - What would `responseData`, `responseString` or `responseJSON` do for a download request? Stream request? + +At a high level, Alamofire 4 now has four `Request` subclasses that each support their own custom chained APIs. This allows each subclass to create extensions tailored to that specific type of request. + +```swift +open class Request { + // Contains common properties, authentication and state methods as well as + // CustomStringConvertible and CustomDebugStringConvertible conformance +} + +open class DataRequest: Request { + // Contains stream (not to be confused with StreamRequest) and download progress methods. +} + +open class DownloadRequest: Request { + // Contains download destination and options, resume data and download progress methods. +} + +open class UploadRequest: DataRequest { + // Inherits all DataRequest APIs and also contains upload progress methods. +} + +open class StreamRequest: Request { + // Only inherits Request APIs, there are no other custom APIs at this time. +} +``` + +By making this split, Alamofire 4 was able to create customized chaining APIs for each type of `Request`. This opened up all sorts of possibilities, but let's take a moment to focus on what this change means in terms of progress reporting and download destinations. + +> See [PR-1455](https://github.com/Alamofire/Alamofire/pull/1455) for more info. + +#### Download and Upload Progress + +The progress reporting system for data, download and upload requests has been completely redesigned. Each request type contains progress APIs for executing a closure during each progress update by returning the underlying `Progress` instance. The closure will be called on the specified queue that defaults to main. + +**Data Request Progress** + +```swift +Alamofire.request(urlString) + .downloadProgress { progress in + // Called on main dispatch queue by default + print("Download progress: \(progress.fractionCompleted)") + } + .responseJSON { response in + debugPrint(response) + } +``` + +**Download Request Progress** + +```swift +Alamofire.download(urlString, to: destination) + .downloadProgress(queue: DispatchQueue.global(qos: .utility)) { progress in + // Called on utility dispatch queue + print("Download progress: \(progress.fractionCompleted)") + } + .responseJSON { response in + debugPrint(response) + } +``` + +**Upload Request Progress** + +```swift +Alamofire.upload(data, to: urlString, withMethod: .post) + .uploadProgress { progress in + // Called on main dispatch queue by default + print("Upload progress: \(progress.fractionCompleted)") + } + .downloadProgress { progress in + // Called on main dispatch queue by default + print("Download progress: \(progress.fractionCompleted)") + } + .responseData { response in + debugPrint(response) + } +``` + +It's now easy to differentiate between upload and download progress for upload requests. + +> See [PR-1455](https://github.com/Alamofire/Alamofire/pull/1455) for more info. + +#### Download File Destinations + +In Alamofire 3.x, successful download requests would always move the temporary file to a final destination URL provided by the `destination` closure. While this was a nice convenience, it had several limitations: + +- `Forced` - The API forces you to provide a destination closure to move the file even if you have a valid use case for not moving it. +- `Limiting` - There was no way to adjust the file system prior to moving the file. + - What if you need to delete a pre-existing file at the destination URL before moving the temporary file? + - What if you need to create intermediate directories to the destination URL before moving the temporary file? + +These limitations led to several enhancements in Alamofire 4. The first of which is the optionality of the destination closure. Now, by default, the `destination` closure is `nil` which means the file is not moved anywhere on the file system and the temporary URL is returned. + +```swift +Alamofire.download(urlString).responseData { response in + print("Temporary URL: \(response.temporaryURL)") +} +``` + +> We'll cover the `DownloadResponse` type in more detail in the [Reponse Serializers](#response-serializers) section. + +#### Download Options + +The other major change made was to add download options to the destination closure allowing more file system control over the move operation. To accomplish this, the `DownloadOptions` type was created and added to the `DownloadFileDestination` closure. + +```swift +public typealias DownloadFileDestination = ( + _ temporaryURL: URL, + _ response: HTTPURLResponse) + -> (destinationURL: URL, options: DownloadOptions) +``` + +The two currently supported `DownloadOptions` are: + +- `.createIntermediateDirectories` - Creates intermediate directories for the destination URL if specified. +- `.removePreviousFile` - Removes a previous file from the destination URL if specified. + +They can then be used as follows: + +```swift +let destination: DownloadRequest.DownloadFileDestination = { _, _ in + return (fileURL, [.removePreviousFile, .createIntermediateDirectories]) +} + +Alamofire.download(urlString, to: destination).response { response in + debugPrint(response) +} +``` + +If an error occurs during the file system operations, the `error` on the `DownloadResponse` will be of type `URLError`. + +> See [PR-1462](https://github.com/Alamofire/Alamofire/pull/1462) for more info. + +### Response Validation + +There were several opportunity areas for improving the response validation system in Alamofire 4. These areas included: + +- Exposing the underlying `data` to the `Validation` closure. +- Custom validation between different `Request` subclasses types allowing `temporaryURL` and `destinationURL` to be exposed for download requests. + +By creating `Request` subclasses, the validation closure typealias and request APIs were able to be tailored to each request type. + +#### Data Request + +The `Validation` closure exposed on the `DataRequest` (inherited by `UploadRequest`) is now as follows: + +```swift +extension DataRequest { + public typealias Validation = (URLRequest?, HTTPURLResponse, Data?) -> ValidationResult +} +``` + +By exposing the `Data?` property directly in the closure, you no longer have to write an extension on `Request` to access it. Now you can do something like this: + +```swift +Alamofire.request(urlString) + .validate { request, response, data in + guard let data = data else { return .failure(customError) } + + // 1) Validate the response to make sure everything looks good + // 2) If validation fails, you can now parse the error message out of the + // data if necessary and add that to your custom error if you wish. + + return .success + } + .response { response in + debugPrint(response) + } +``` + +#### Download Request + +The `Validation` closure on the `DownloadRequest` is very similar to the `DataRequest` API, but tailored more to downloads. + +```swift +extension DownloadRequest { + public typealias Validation = ( + _ request: URLRequest?, + _ response: HTTPURLResponse, + _ temporaryURL: URL?, + _ destinationURL: URL?) + -> ValidationResult +} +``` + +The `temporaryURL` and `destinationURL` parameters now allow you access the data returned by the server directly in an inline closure. This allows you to inspect the data inside the file if you've determined you need to in order to create a custom error. + +```swift +Alamofire.download(urlString) + .validate { request, response, temporaryURL, destinationURL in + guard let fileURL = temporaryURL else { return .failure(customError) } + + do { + let _ = try Data(contentsOf: fileURL) + return .success + } catch { + return .failure(customError) + } + } + .response { response in + debugPrint(response) + } +``` + +By exposing the underlying server data directly to the inline closures, error messages embedded in those responses can be parsed out inside the `Validation` closure to create a custom error including the server error message. If the payload is the same schema as used in a response serializer closure, the response serializer could be called to parse out the error message rather than duplicating the logic. For an example of how to do this, please refer to the README. + +> See [PR-1461](https://github.com/Alamofire/Alamofire/pull/1461) for more info. + +### Response Serializers + +The response serialization system in Alamofire 3.x had several pretty severe limitations: + +- Response serialization APIs could be applied to download and stream requests but resulted in undefined behavior. + - How do you access the fileURL when a download is complete? + - What would `responseData`, `responseString` or `responseJSON` do when chained onto a download request? A stream request? +- The `response` API returned 4 parameters instead of an encapsulating `Response` type. + - The biggest issue here is that any change to that API could not be done in a backwards compatible manner. + - Created confusion when switching between the serialized and unserialized APIs which led to difficult to debug compiler errors. + +As you can see, there were some very strong limitations to this system in Alamofire 3.x. Therefore, in Alamofire 4, the `Request` type was first broken down into subclasses, which opened up the opportunity to create customized response serializers and APIs for specific types of requests. Before getting to far into response serializers, we should first walk through the new `Response` types. + +#### Default Data Response + +The `DefaultDataResponse` represents an unserialized server response. There's no Alamofire processing that happens, it just collects all the response information from the `SessionDelegate` APIs and returns it in a simple struct. + +```swift +public struct DefaultDataResponse { + public let request: URLRequest? + public let response: HTTPURLResponse? + public let data: Data? + public let error: Error? + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +} +``` + +This is the type of response you will get back from the `DataRequest.response` API. + +```swift +Alamofire.request(urlString).response { response in + debugPrint(response) +} + +Alamofire.upload(file, to: urlString).response { response in + debugPrint(response) +} +``` + +#### Data Response + +The generic `DataResponse` type is the same as the generic `Response` in Alamofire 3.x, but refactored and contains the new `metrics` property. + +```swift +public struct DataResponse { + public let request: URLRequest? + public let response: HTTPURLResponse? + public let data: Data? + public let result: Result + public let timeline: Timeline + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +} +``` + +You still have access to the same response serialization APIs as before on the `DataRequest` and `UploadRequest` types. + +```swift +Alamofire.request(urlString).responseJSON { response in + debugPrint(response) + print(response.result.isSuccess) +} + +Alamofire.upload(fileURL, to: urlString).responseData { response in + debugPrint(response) + print(response.result.isSuccess) +} +``` + +#### Default Download Response + +Since downloads work differently than data and upload requests, Alamofire 4 contains custom download `Response` types tailored to their behavior. The `DefaultDownloadResponse` type represents an unserialized server response for a `DownloadRequest` that collects all the `SessionDelegate` information into a simple struct. + +```swift +public struct DefaultDownloadResponse { + public let request: URLRequest? + public let response: HTTPURLResponse? + public let temporaryURL: URL? + public let destinationURL: URL? + public let resumeData: Data? + public let error: Error? + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +} +``` + +The `DefaultDownloadResponse` type is returned when using the new `DownloadRequest.response` API. + +```swift +Alamofire.download(urlString).response { response in + debugPrint(response) + print(response.temporaryURL) +} +``` + +#### Download Response + +The new generic `DownloadResponse` type is similar to the generic `DataResponse` type, but contains information tailored to download requests. The `DownloadResponse` type is returned when one of four new APIs exposed on the `DownloadRequest` type. These new APIs match the `DataRequest` ones, and provide the same functionality by loading the data from the underlying temporary or destination URL. + +```swift +Alamofire.download(urlString, to: destination) + .responseData { response in + debugPrint(response) + } + .responseString { response in + debugPrint(response) + } + .responseJSON { response in + debugPrint(response) + } + .responsePropertyList { response in + debugPrint(response) + } +``` + +These new response serialization APIs make it MUCH easier to download a request to a file and serialize the response all in a single call. + +#### Custom Response Serializers + +If you have created your own custom response serializers, you may want to extend support across both data and download requests similar to what we've done with the Alamofire response serializers. If you do decide to do this, take a close look at how Alamofire shares the response serializer implementation between both request types by moving the implementation to the `Request`. This allowed us to DRY up our logic to avoid duplication between types. + +> See [PR-1457](https://github.com/Alamofire/Alamofire/pull/1457) for more info. diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/AppDelegate.swift b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/AppDelegate.swift deleted file mode 100644 index 7d7008e..0000000 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/AppDelegate.swift +++ /dev/null @@ -1,61 +0,0 @@ -// AppDelegate.swift -// -// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDelegate { - - var window: UIWindow? - - // MARK: - UIApplicationDelegate - - func application( - application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) - -> Bool - { - let splitViewController = window!.rootViewController as! UISplitViewController - let navigationController = splitViewController.viewControllers.last as! UINavigationController - navigationController.topViewController!.navigationItem.leftBarButtonItem = splitViewController.displayModeButtonItem() - splitViewController.delegate = self - - return true - } - - // MARK: - UISplitViewControllerDelegate - - func splitViewController( - splitViewController: UISplitViewController, - collapseSecondaryViewController secondaryViewController: UIViewController, - ontoPrimaryViewController primaryViewController: UIViewController) - -> Bool - { - if let secondaryAsNavController = secondaryViewController as? UINavigationController { - if let topAsDetailController = secondaryAsNavController.topViewController as? DetailViewController { - return topAsDetailController.request == nil - } - } - - return false - } -} diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/DetailViewController.swift b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/DetailViewController.swift deleted file mode 100644 index 4f02b85..0000000 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/DetailViewController.swift +++ /dev/null @@ -1,204 +0,0 @@ -// DetailViewController.swift -// -// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Alamofire -import UIKit - -class DetailViewController: UITableViewController { - enum Sections: Int { - case Headers, Body - } - - var request: Alamofire.Request? { - didSet { - oldValue?.cancel() - - title = request?.description - refreshControl?.endRefreshing() - headers.removeAll() - body = nil - elapsedTime = nil - } - } - - var headers: [String: String] = [:] - var body: String? - var elapsedTime: NSTimeInterval? - var segueIdentifier: String? - - static let numberFormatter: NSNumberFormatter = { - let formatter = NSNumberFormatter() - formatter.numberStyle = .DecimalStyle - return formatter - }() - - // MARK: View Lifecycle - - override func awakeFromNib() { - super.awakeFromNib() - refreshControl?.addTarget(self, action: "refresh", forControlEvents: .ValueChanged) - - } - - override func viewDidAppear(animated: Bool) { - super.viewDidAppear(animated) - - refresh() - } - - // MARK: IBActions - - @IBAction func refresh() { - guard let request = request else { - return - } - - refreshControl?.beginRefreshing() - - let start = CACurrentMediaTime() - request.responseString { response in - let end = CACurrentMediaTime() - self.elapsedTime = end - start - - if let response = response.response { - for (field, value) in response.allHeaderFields { - self.headers["\(field)"] = "\(value)" - } - } - - if let segueIdentifier = self.segueIdentifier { - switch segueIdentifier { - case "GET", "POST", "PUT", "DELETE": - self.body = response.result.value - case "DOWNLOAD": - self.body = self.downloadedBodyString() - default: - break - } - } - - self.tableView.reloadData() - self.refreshControl?.endRefreshing() - } - } - - private func downloadedBodyString() -> String { - let fileManager = NSFileManager.defaultManager() - let cachesDirectory = fileManager.URLsForDirectory(.CachesDirectory, inDomains: .UserDomainMask)[0] - - do { - let contents = try fileManager.contentsOfDirectoryAtURL( - cachesDirectory, - includingPropertiesForKeys: nil, - options: .SkipsHiddenFiles - ) - - if let - fileURL = contents.first, - data = NSData(contentsOfURL: fileURL) - { - let json = try NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions()) - let prettyData = try NSJSONSerialization.dataWithJSONObject(json, options: .PrettyPrinted) - - if let prettyString = NSString(data: prettyData, encoding: NSUTF8StringEncoding) as? String { - try fileManager.removeItemAtURL(fileURL) - return prettyString - } - } - } catch { - // No-op - } - - return "" - } -} - -// MARK: - UITableViewDataSource - -extension DetailViewController { - override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - switch Sections(rawValue: section)! { - case .Headers: - return headers.count - case .Body: - return body == nil ? 0 : 1 - } - } - - override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { - switch Sections(rawValue: indexPath.section)! { - case .Headers: - let cell = tableView.dequeueReusableCellWithIdentifier("Header")! - let field = headers.keys.sort(<)[indexPath.row] - let value = headers[field] - - cell.textLabel?.text = field - cell.detailTextLabel?.text = value - - return cell - case .Body: - let cell = tableView.dequeueReusableCellWithIdentifier("Body")! - cell.textLabel?.text = body - - return cell - } - } -} - -// MARK: - UITableViewDelegate - -extension DetailViewController { - override func numberOfSectionsInTableView(tableView: UITableView) -> Int { - return 2 - } - - override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - if self.tableView(tableView, numberOfRowsInSection: section) == 0 { - return "" - } - - switch Sections(rawValue: section)! { - case .Headers: - return "Headers" - case .Body: - return "Body" - } - } - - override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat { - switch Sections(rawValue: indexPath.section)! { - case .Body: - return 300 - default: - return tableView.rowHeight - } - } - - override func tableView(tableView: UITableView, titleForFooterInSection section: Int) -> String? { - if Sections(rawValue: section) == .Body, let elapsedTime = elapsedTime { - let elapsedTimeText = DetailViewController.numberFormatter.stringFromNumber(elapsedTime) ?? "???" - return "Elapsed Time: \(elapsedTimeText) sec" - } - - return "" - } -} diff --git "a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Images.xcassets/LaunchImage.launchimage/Icon\r" "b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Images.xcassets/LaunchImage.launchimage/Icon\r" deleted file mode 100644 index e69de29..0000000 diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Images.xcassets/Logo.imageset/Contents.json b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Images.xcassets/Logo.imageset/Contents.json deleted file mode 100644 index b75f650..0000000 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Images.xcassets/Logo.imageset/Contents.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x", - "filename" : "Logo.png" - }, - { - "idiom" : "universal", - "scale" : "2x", - "filename" : "Logo@2x.png" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git "a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Images.xcassets/Logo.imageset/Icon\r" "b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Images.xcassets/Logo.imageset/Icon\r" deleted file mode 100644 index e69de29..0000000 diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/MasterViewController.swift b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/MasterViewController.swift deleted file mode 100644 index a6e365b..0000000 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/MasterViewController.swift +++ /dev/null @@ -1,95 +0,0 @@ -// MasterViewController.swift -// -// Copyright (c) 2014–2015 Alamofire Software Foundation (http://alamofire.org/) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Alamofire -import UIKit - -class MasterViewController: UITableViewController { - - @IBOutlet weak var titleImageView: UIImageView! - - var detailViewController: DetailViewController? = nil - var objects = NSMutableArray() - - // MARK: - View Lifecycle - - override func awakeFromNib() { - super.awakeFromNib() - - navigationItem.titleView = titleImageView - } - - override func viewDidLoad() { - super.viewDidLoad() - - if let split = splitViewController { - let controllers = split.viewControllers - - if let - navigationController = controllers.last as? UINavigationController, - topViewController = navigationController.topViewController as? DetailViewController - { - detailViewController = topViewController - } - } - } - - // MARK: - UIStoryboardSegue - - override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { - if let - navigationController = segue.destinationViewController as? UINavigationController, - detailViewController = navigationController.topViewController as? DetailViewController - { - func requestForSegue(segue: UIStoryboardSegue) -> Request? { - switch segue.identifier! { - case "GET": - detailViewController.segueIdentifier = "GET" - return Alamofire.request(.GET, "https://httpbin.org/get") - case "POST": - detailViewController.segueIdentifier = "POST" - return Alamofire.request(.POST, "https://httpbin.org/post") - case "PUT": - detailViewController.segueIdentifier = "PUT" - return Alamofire.request(.PUT, "https://httpbin.org/put") - case "DELETE": - detailViewController.segueIdentifier = "DELETE" - return Alamofire.request(.DELETE, "https://httpbin.org/delete") - case "DOWNLOAD": - detailViewController.segueIdentifier = "DOWNLOAD" - let destination = Alamofire.Request.suggestedDownloadDestination( - directory: .CachesDirectory, - domain: .UserDomainMask - ) - return Alamofire.download(.GET, "https://httpbin.org/stream/1", destination: destination) - default: - return nil - } - } - - if let request = requestForSegue(segue) { - detailViewController.request = request - } - } - } -} - diff --git a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Base.lproj/Main.storyboard b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Resources/Base.lproj/Main.storyboard old mode 100644 new mode 100755 similarity index 94% rename from Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Base.lproj/Main.storyboard rename to Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Resources/Base.lproj/Main.storyboard index b47367a..6f3cd58 --- a/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Base.lproj/Main.storyboard +++ b/Chapter8/Chapter8-1/NewsReader/Alamofire-master/Example/Resources/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - + - + + @@ -45,14 +46,14 @@ - + - + - + - + - + - + - + - +