From 8eb0d08b122038aa030a9a61f5a487984f7b5809 Mon Sep 17 00:00:00 2001 From: mttcrsp Date: Sun, 7 Oct 2018 14:46:37 +0200 Subject: [PATCH 1/5] Bump Swift version to 4.2 for all targets --- .../project.pbxproj | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 0c712b9f..3f7a6848 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -1162,7 +1162,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -1183,7 +1182,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -1206,7 +1204,6 @@ PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.2; TEST_TARGET_NAME = "Example-iOS"; }; name = Debug; @@ -1229,7 +1226,6 @@ PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; TEST_TARGET_NAME = "Example-iOS"; }; name = Release; @@ -1292,7 +1288,7 @@ SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1348,7 +1344,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -1373,7 +1369,6 @@ PRODUCT_NAME = QuickTableViewController; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -1394,7 +1389,6 @@ PRODUCT_NAME = QuickTableViewController; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; }; name = Release; }; @@ -1416,7 +1410,6 @@ PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewControllerTests; PRODUCT_NAME = QuickTableViewControllerTests; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1435,7 +1428,6 @@ PRODUCT_NAME = QuickTableViewControllerTests; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; }; name = Release; }; @@ -1464,7 +1456,6 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -1494,7 +1485,6 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -1520,7 +1510,6 @@ PRODUCT_NAME = QuickTableViewControllerTests; SDKROOT = appletvos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 11.3; }; @@ -1545,7 +1534,6 @@ PRODUCT_NAME = QuickTableViewControllerTests; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 11.3; }; @@ -1572,7 +1560,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -1598,7 +1585,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; From 0e3bd8865559c06ffd802550ac3d0594602caee8 Mon Sep 17 00:00:00 2001 From: mttcrsp Date: Sun, 7 Oct 2018 14:46:53 +0200 Subject: [PATCH 2/5] Migrate the iOS tests target to Swift 4.2 --- Tests/Row/OptionRowSpec.swift | 8 ++++---- Tests/ViewController/QuickTableViewControllerSpec.swift | 4 ++-- Tests/ViewController/QuickTableViewDataSourceSpec.swift | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Tests/Row/OptionRowSpec.swift b/Tests/Row/OptionRowSpec.swift index 1bc917f2..b3664e55 100644 --- a/Tests/Row/OptionRowSpec.swift +++ b/Tests/Row/OptionRowSpec.swift @@ -48,9 +48,9 @@ internal final class OptionRowSpec: QuickSpec { // RowStyle expect(row.cellReuseIdentifier) == "UITableViewCell" - expect(row.cellStyle) == UITableViewCellStyle.default + expect(row.cellStyle) == UITableViewCell.CellStyle.default expect(row.icon) == icon - expect(row.accessoryType) == UITableViewCellAccessoryType.checkmark + expect(row.accessoryType) == UITableViewCell.AccessoryType.checkmark expect(row.isSelectable) == true expect(row.customize).to(beNil()) } @@ -106,7 +106,7 @@ internal final class OptionRowSpec: QuickSpec { it("should invoke the action closure") { row.isSelected = true - expect(row.accessoryType) == UITableViewCellAccessoryType.checkmark + expect(row.accessoryType) == UITableViewCell.AccessoryType.checkmark expect(invoked).toEventually(beTrue()) } } @@ -117,7 +117,7 @@ internal final class OptionRowSpec: QuickSpec { it("should not invoke the action closure") { row.isSelected = false - expect(row.accessoryType) == UITableViewCellAccessoryType.none + expect(row.accessoryType) == UITableViewCell.AccessoryType.none expect(invoked).toEventually(beFalse()) } } diff --git a/Tests/ViewController/QuickTableViewControllerSpec.swift b/Tests/ViewController/QuickTableViewControllerSpec.swift index 1c1bde67..bd37f761 100644 --- a/Tests/ViewController/QuickTableViewControllerSpec.swift +++ b/Tests/ViewController/QuickTableViewControllerSpec.swift @@ -36,8 +36,8 @@ internal final class QuickTableViewControllerSpec: QuickSpec { describe("init(style:)") { it("should set up table view with style") { - expect(QuickTableViewController().tableView.style) == UITableViewStyle.grouped - expect(QuickTableViewController(style: .plain).tableView.style) == UITableViewStyle.plain + expect(QuickTableViewController().tableView.style) == UITableView.Style.grouped + expect(QuickTableViewController(style: .plain).tableView.style) == UITableView.Style.plain } } diff --git a/Tests/ViewController/QuickTableViewDataSourceSpec.swift b/Tests/ViewController/QuickTableViewDataSourceSpec.swift index 0d46c188..9fc80fb5 100644 --- a/Tests/ViewController/QuickTableViewDataSourceSpec.swift +++ b/Tests/ViewController/QuickTableViewDataSourceSpec.swift @@ -220,7 +220,7 @@ internal final class QuickTableViewDataSourceSpec: QuickSpec { it("should have the disclosure indicator") { for row in 0...3 { let cell = controller.tableView(controller.tableView, cellForRowAt: IndexPath(row: row, section: 0)) - expect(cell.accessoryType) == UITableViewCellAccessoryType.disclosureIndicator + expect(cell.accessoryType) == UITableViewCell.AccessoryType.disclosureIndicator } } } @@ -316,7 +316,7 @@ internal final class QuickTableViewDataSourceSpec: QuickSpec { } it("should match the selection at \(index)") { - expect(cell.accessoryType) == UITableViewCellAccessoryType.checkmark + expect(cell.accessoryType) == UITableViewCell.AccessoryType.checkmark } } } From 92c05241bf8a1bb6b9ec145f1558025852642c26 Mon Sep 17 00:00:00 2001 From: mttcrsp Date: Sun, 7 Oct 2018 14:47:02 +0200 Subject: [PATCH 3/5] Migrate the tvOS tests target to Swift 4.2 --- Tests/View/ConfigurableSpec.swift | 16 ++++++++-------- .../QuickTableViewDataSourceSpec.swift | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Tests/View/ConfigurableSpec.swift b/Tests/View/ConfigurableSpec.swift index 3251838d..b33cbccb 100644 --- a/Tests/View/ConfigurableSpec.swift +++ b/Tests/View/ConfigurableSpec.swift @@ -42,7 +42,7 @@ internal final class ConfigurableSpec: QuickSpec { expect(cell.switchControl.isOn) == true #elseif os(tvOS) expect(cell.accessoryView).to(beNil()) - expect(cell.accessoryType) == UITableViewCellAccessoryType.checkmark + expect(cell.accessoryType) == UITableViewCell.AccessoryType.checkmark #endif } @@ -55,7 +55,7 @@ internal final class ConfigurableSpec: QuickSpec { expect(cell.switchControl.isOn) == false #elseif os(tvOS) expect(cell.accessoryView).to(beNil()) - expect(cell.accessoryType) == UITableViewCellAccessoryType.none + expect(cell.accessoryType) == UITableViewCell.AccessoryType.none #endif } } @@ -70,7 +70,7 @@ internal final class ConfigurableSpec: QuickSpec { expect(cell.switchControl.isOn) == true #elseif os(tvOS) expect(cell.accessoryView).to(beNil()) - expect(cell.accessoryType) == UITableViewCellAccessoryType.checkmark + expect(cell.accessoryType) == UITableViewCell.AccessoryType.checkmark #endif } @@ -83,7 +83,7 @@ internal final class ConfigurableSpec: QuickSpec { expect(cell.switchControl.isOn) == false #elseif os(tvOS) expect(cell.accessoryView).to(beNil()) - expect(cell.accessoryType) == UITableViewCellAccessoryType.none + expect(cell.accessoryType) == UITableViewCell.AccessoryType.none #endif } } @@ -98,7 +98,7 @@ internal final class ConfigurableSpec: QuickSpec { expect(cell.switchControl.isOn) == true #elseif os(tvOS) expect(cell.accessoryView).to(beNil()) - expect(cell.accessoryType) == UITableViewCellAccessoryType.checkmark + expect(cell.accessoryType) == UITableViewCell.AccessoryType.checkmark #endif } @@ -111,7 +111,7 @@ internal final class ConfigurableSpec: QuickSpec { expect(cell.switchControl.isOn) == false #elseif os(tvOS) expect(cell.accessoryView).to(beNil()) - expect(cell.accessoryType) == UITableViewCellAccessoryType.none + expect(cell.accessoryType) == UITableViewCell.AccessoryType.none #endif } } @@ -126,7 +126,7 @@ internal final class ConfigurableSpec: QuickSpec { expect(cell.switchControl.isOn) == true #elseif os(tvOS) expect(cell.accessoryView).to(beNil()) - expect(cell.accessoryType) == UITableViewCellAccessoryType.checkmark + expect(cell.accessoryType) == UITableViewCell.AccessoryType.checkmark #endif } @@ -139,7 +139,7 @@ internal final class ConfigurableSpec: QuickSpec { expect(cell.switchControl.isOn) == false #elseif os(tvOS) expect(cell.accessoryView).to(beNil()) - expect(cell.accessoryType) == UITableViewCellAccessoryType.none + expect(cell.accessoryType) == UITableViewCell.AccessoryType.none #endif } } diff --git a/Tests/ViewController/QuickTableViewDataSourceSpec.swift b/Tests/ViewController/QuickTableViewDataSourceSpec.swift index 9fc80fb5..b2cce0ac 100644 --- a/Tests/ViewController/QuickTableViewDataSourceSpec.swift +++ b/Tests/ViewController/QuickTableViewDataSourceSpec.swift @@ -256,7 +256,7 @@ internal final class QuickTableViewDataSourceSpec: QuickSpec { #if os(iOS) expect((cell as? SwitchCell)?.switchControl.isOn) == true #elseif os(tvOS) - expect(cell.accessoryType) == UITableViewCellAccessoryType.checkmark + expect(cell.accessoryType) == UITableViewCell.AccessoryType.checkmark #endif } } From f1d888b63f0ee6ed3f6d8f37b2a7b751c863ea8f Mon Sep 17 00:00:00 2001 From: mttcrsp Date: Sun, 7 Oct 2018 14:47:09 +0200 Subject: [PATCH 4/5] Update workspace to Xcode 10 recommended settings --- .../xcshareddata/xcschemes/Example-iOS.xcscheme | 2 +- .../xcshareddata/xcschemes/Example-tvOS.xcscheme | 2 +- .../xcschemes/QuickTableViewController-iOS.xcscheme | 2 +- .../xcschemes/QuickTableViewController-tvOS.xcscheme | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme index 6d7797e0..fae8fcd3 100644 --- a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme +++ b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme @@ -1,6 +1,6 @@ Date: Mon, 8 Oct 2018 21:08:34 +0200 Subject: [PATCH 5/5] Inhibit Quick warnings for test targets At this time the Quick testing framework hasn't yet been updated to Swift 4.2. This causing some compilation warnings to be generated by the compiler. While discussing #26, it was decided to solve this issue by inhibiting warnings generated by the Quick pod for tests target. --- Podfile | 4 ++-- Podfile.lock | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Podfile b/Podfile index d6075681..3ee73041 100644 --- a/Podfile +++ b/Podfile @@ -6,13 +6,13 @@ project "QuickTableViewController" target "QuickTableViewController-iOSTests" do platform :ios, "8.0" pod "Nimble", git: "https://github.com/Quick/Nimble.git", tag: "v7.1.3" - pod "Quick", git: "https://github.com/Quick/Quick.git", tag: "v1.3.1" + pod "Quick", git: "https://github.com/Quick/Quick.git", tag: "v1.3.1", :inhibit_warnings => true end target "QuickTableViewController-tvOSTests" do platform :tvos, "9.0" pod "Nimble", git: "https://github.com/Quick/Nimble.git", tag: "v7.1.3" - pod "Quick", git: "https://github.com/Quick/Quick.git", tag: "v1.3.1" + pod "Quick", git: "https://github.com/Quick/Quick.git", tag: "v1.3.1", :inhibit_warnings => true end target "Example-iOS" do diff --git a/Podfile.lock b/Podfile.lock index 4cda9f7a..ee5ffcba 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -31,6 +31,6 @@ SPEC CHECKSUMS: Quick: d17304d58d0d169dd0bd1c6e5c28e3318de32a1a SwiftLint: 3207c1faa2240bf8973b191820a116113cd11073 -PODFILE CHECKSUM: 6dedfd3b564540ea44d6f3f3bf311afc936ee83a +PODFILE CHECKSUM: 209aaba56acbe1a7575f449d1faebf22752c3f27 COCOAPODS: 1.5.3