From a8c4c0c2fa18c62e28b2f918b5c24920adf79d07 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 20 Mar 2018 23:43:33 +0800 Subject: [PATCH 01/23] Update Gems --- Gemfile.lock | 52 +++++++++++++++++++++++++++------------------------- Podfile.lock | 2 +- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 94543e38..d8f4d068 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,35 +9,36 @@ GEM tzinfo (~> 1.1) addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) + atomos (0.1.2) claide (1.0.2) claide-plugins (0.9.2) cork nap open4 (~> 1.3) - cocoapods (1.3.1) + cocoapods (1.4.0) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.3.1) - cocoapods-deintegrate (>= 1.0.1, < 2.0) + cocoapods-core (= 1.4.0) + cocoapods-deintegrate (>= 1.0.2, < 2.0) cocoapods-downloader (>= 1.1.3, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0) - cocoapods-trunk (>= 1.2.0, < 2.0) + cocoapods-trunk (>= 1.3.0, < 2.0) cocoapods-try (>= 1.1.0, < 2.0) colored2 (~> 3.1) escape (~> 0.0.4) fourflusher (~> 2.0.1) gh_inspector (~> 1.0) - molinillo (~> 0.5.7) + molinillo (~> 0.6.4) nap (~> 1.0) ruby-macho (~> 1.1) - xcodeproj (>= 1.5.1, < 2.0) - cocoapods-core (1.3.1) + xcodeproj (>= 1.5.4, < 2.0) + cocoapods-core (1.4.0) activesupport (>= 4.0.2, < 6) fuzzy_match (~> 2.0.4) nap (~> 1.0) - cocoapods-deintegrate (1.0.1) + cocoapods-deintegrate (1.0.2) cocoapods-downloader (1.1.3) cocoapods-plugins (1.0.0) nap @@ -51,7 +52,7 @@ GEM concurrent-ruby (1.0.5) cork (0.3.0) colored2 (~> 3.1) - danger (5.5.5) + danger (5.5.11) claide (~> 1.0) claide-plugins (>= 0.9.2) colored2 (~> 3.1) @@ -64,30 +65,30 @@ GEM octokit (~> 4.7) terminal-table (~> 1) escape (0.0.4) - faraday (0.13.1) + faraday (0.14.0) multipart-post (>= 1.2, < 3) faraday-http-cache (1.3.1) faraday (~> 0.8) - ffi (1.9.18) + ffi (1.9.23) fourflusher (2.0.1) fuzzy_match (2.0.4) - gh_inspector (1.0.3) + gh_inspector (1.1.3) git (1.3.0) - i18n (0.9.1) + i18n (0.9.5) concurrent-ruby (~> 1.0) - jazzy (0.9.0) + jazzy (0.9.1) cocoapods (~> 1.0) mustache (~> 0.99) open4 redcarpet (~> 3.2) - rouge (~> 1.5) + rouge (>= 2.0.6, < 4.0) sass (~> 3.4) sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) kramdown (1.16.2) liferaft (0.0.6) - minitest (5.10.3) - molinillo (0.5.7) + minitest (5.11.3) + molinillo (0.6.4) multipart-post (2.0.0) mustache (0.99.8) nanaimo (0.2.3) @@ -97,15 +98,15 @@ GEM octokit (4.8.0) sawyer (~> 0.8.0, >= 0.5.3) open4 (1.3.4) - public_suffix (3.0.1) + public_suffix (3.0.2) rake (12.3.0) - rb-fsevent (0.10.2) + rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) redcarpet (3.4.0) - rouge (1.11.1) + rouge (2.0.7) ruby-macho (1.1.0) - sass (3.5.4) + sass (3.5.5) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) @@ -117,18 +118,19 @@ GEM terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) - tzinfo (1.2.4) + tzinfo (1.2.5) thread_safe (~> 0.1) unicode-display_width (1.3.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.5.4) + xcodeproj (1.5.6) CFPropertyList (~> 2.3.3) + atomos (~> 0.1.2) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) nanaimo (~> 0.2.3) - xcpretty (0.2.6) - rouge (~> 1.8) + xcpretty (0.2.8) + rouge (~> 2.0.7) PLATFORMS ruby diff --git a/Podfile.lock b/Podfile.lock index 3a18b313..b3f26548 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -40,4 +40,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: a3841a8adaee9cf3a3e7ab3c47a296a846c65d87 -COCOAPODS: 1.3.1 +COCOAPODS: 1.4.0 From 51e79480f35b0d14aed6cc92347d51af22f4cfb2 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 20 Mar 2018 15:58:13 +0800 Subject: [PATCH 02/23] Use Codecov default yaml except the ignoring paths --- .codecov.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 7ffadb82..1d318d85 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,7 +1,7 @@ coverage: ignore: - - Carthage/* - - Example/* - - ExampleUITests/* - - QuickTableViewControllerTests/* - - Pods/* + - Carthage/.* + - Example/.* + - ExampleUITests/.* + - QuickTableViewControllerTests/.* + - Pods/.* From 0e304af4b3484385d202f2d56a37ee91df9e1ff2 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 21 Mar 2018 15:22:09 +0800 Subject: [PATCH 03/23] Speed up the build by specifying packages to build coverage --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index db4ed90f..8d60b883 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ script: - make -B carthage - make -B docs after_success: - # - bash <(curl -s https://codecov.io/bash) -cF ios + - bash <(curl -s https://codecov.io/bash) -cF ios -J "QuickTableViewController" - sh scripts/update-docs.sh notifications: email: false From 2155afa0ed9e09fc49772d6ce6677f4763d7f42e Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 21 Mar 2018 15:35:46 +0800 Subject: [PATCH 04/23] Parse code coverage right after running tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8d60b883..8768ab39 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,11 +17,11 @@ before_script: - if [ -n "$DANGER_GITHUB_API_TOKEN" ]; then bundle exec danger; fi script: - bundle exec rake ci:test[QuickTableViewController-iOS] + - bash <(curl -s https://codecov.io/bash) -cF ios -J "QuickTableViewController" - bundle exec rake ci:test[Example] - make -B carthage - make -B docs after_success: - - bash <(curl -s https://codecov.io/bash) -cF ios -J "QuickTableViewController" - sh scripts/update-docs.sh notifications: email: false From 8c677beb60e1235140d2db660256eb144a9a2ec1 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 21 Mar 2018 15:58:01 +0800 Subject: [PATCH 05/23] Use Xcode 9.2 on Travis CI --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8768ab39..17f968cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode9 +osx_image: xcode9.2 matrix: include: - env: VERSION=latest From 52eb8796712819ac845eba329f6ac738fd2707ba Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 18 Mar 2018 16:39:20 +0800 Subject: [PATCH 06/23] Change the icon type from struct to enum --- CHANGELOG.md | 6 ++ .../AppIcon.appiconset/Contents.json | 15 ++++ .../DefaultViewController.swift | 10 +-- QuickTableViewControllerTests/IconSpec.swift | 30 +++----- .../NavigationRowSpec.swift | 14 ++-- .../OptionRowSpec.swift | 4 +- .../QuickTableViewDataSourceSpec.swift | 14 ++-- .../SwitchRowSpec.swift | 2 +- README.md | 11 +-- Source/Model/Icon.swift | 68 +++++++++---------- 10 files changed, 94 insertions(+), 80 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5752e48c..a1246aea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## v0.9.0 + +#### Breaking + +* Change the `Icon` type from struct to enum + ## v0.8.4 #### Fixes diff --git a/Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Assets.xcassets/AppIcon.appiconset/Contents.json index 118c98f7..19882d56 100644 --- a/Example/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/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", @@ -29,6 +39,11 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/Example/ViewControllers/DefaultViewController.swift b/Example/ViewControllers/DefaultViewController.swift index 7b613d88..70d8268e 100644 --- a/Example/ViewControllers/DefaultViewController.swift +++ b/Example/ViewControllers/DefaultViewController.swift @@ -46,8 +46,8 @@ internal final class DefaultViewController: QuickTableViewController { tableContents = [ Section(title: "Switch", rows: [ - SwitchRow(title: "Setting 1", switchValue: true, icon: Icon(image: globe), action: weakify(self, type(of: self).didToggleSwitch)), - SwitchRow(title: "Setting 2", switchValue: false, icon: Icon(image: time), action: weakify(self, type(of: self).didToggleSwitch)) + SwitchRow(title: "Setting 1", switchValue: true, icon: .image(globe), action: weakify(self, type(of: self).didToggleSwitch)), + SwitchRow(title: "Setting 2", switchValue: false, icon: .image(time), action: weakify(self, type(of: self).didToggleSwitch)) ]), Section(title: "Tap Action", rows: [ @@ -55,9 +55,9 @@ internal final class DefaultViewController: QuickTableViewController { ]), Section(title: "Navigation", rows: [ - NavigationRow(title: "CellStyle.default", subtitle: .none, icon: Icon(image: gear)), - NavigationRow(title: "CellStyle", subtitle: .belowTitle(".subtitle"), icon: Icon(image: globe)), - NavigationRow(title: "CellStyle", subtitle: .rightAligned(".value1"), icon: Icon(image: time), action: weakify(self, type(of: self).showDetail)), + NavigationRow(title: "CellStyle.default", subtitle: .none, icon: .image(gear)), + NavigationRow(title: "CellStyle", subtitle: .belowTitle(".subtitle"), icon: .image(globe)), + NavigationRow(title: "CellStyle", subtitle: .rightAligned(".value1"), icon: .image(time), action: weakify(self, type(of: self).showDetail)), NavigationRow(title: "CellStyle", subtitle: .leftAligned(".value2")) ], footer: "UITableViewCellStyle.Value2 hides the image view."), diff --git a/QuickTableViewControllerTests/IconSpec.swift b/QuickTableViewControllerTests/IconSpec.swift index c03f8101..e8b426ee 100644 --- a/QuickTableViewControllerTests/IconSpec.swift +++ b/QuickTableViewControllerTests/IconSpec.swift @@ -36,57 +36,49 @@ internal final class IconSpec: QuickSpec { let image = UIImage() context("image") { - let icon = Icon(image: image) + let icon = Icon.image(image) it("should initialize with the image") { expect(icon.image) == image expect(icon.highlightedImage).to(beNil()) - expect(icon.imageName).to(beNil()) } } context("image name") { - let icon = Icon(imageName: "name") + let icon = Icon.named("name") it("should initialize with the image name") { expect(icon.image).to(beNil()) expect(icon.highlightedImage).to(beNil()) - expect(icon.imageName) == "name" } } } describe("equatable") { let image = UIImage() - let a = Icon(image: image) + let a = Icon.image(image) context("identical images") { - let b = Icon(image: image) + let b = Icon.image(image) it("should be equal") { expect(a) == b } } context("different images") { - let c = Icon(image: UIImage()) + let c = Icon.image(UIImage()) it("should not be equal") { expect(a) != c } } - context("nil highlighted images") { - let d = Icon(image: image, highlightedImage: nil) - it("should be equal") { - expect(a) == d - } - } - context("different highlighted images") { - let e = Icon(image: image, highlightedImage: UIImage()) + let d = Icon.images(normal: image, highlighted: UIImage()) + let e = Icon.images(normal: image, highlighted: UIImage()) it("should not be equal") { - expect(a) != e + expect(d) != e } } - let f = Icon(imageName: "Same") + let f = Icon.named("Same") context("different image specification") { it("should not be queal") { @@ -95,14 +87,14 @@ internal final class IconSpec: QuickSpec { } context("identical image names") { - let g = Icon(imageName: "Same") + let g = Icon.named("Same") it("should be eqaul") { expect(f) == g } } context("different image names") { - let h = Icon(imageName: "Different") + let h = Icon.named("Different") it("should not be equal") { expect(f) != h } diff --git a/QuickTableViewControllerTests/NavigationRowSpec.swift b/QuickTableViewControllerTests/NavigationRowSpec.swift index 1f6ede11..f6c784cb 100644 --- a/QuickTableViewControllerTests/NavigationRowSpec.swift +++ b/QuickTableViewControllerTests/NavigationRowSpec.swift @@ -33,7 +33,7 @@ internal final class NavigationRowSpec: QuickSpec { override func spec() { describe("initialization") { let subtitle = Subtitle.belowTitle("subtitle") - let icon = Icon(imageName: "icon") + let icon = Icon.named("icon") var invoked = false let row = NavigationRow(title: "title", subtitle: subtitle, icon: icon, action: { _ in invoked = true }) @@ -66,38 +66,38 @@ internal final class NavigationRowSpec: QuickSpec { describe("equatable") { let image = UIImage() - let a = NavigationRow(title: "Same", subtitle: .belowTitle("Same"), icon: Icon(image: image), action: nil) + let a = NavigationRow(title: "Same", subtitle: .belowTitle("Same"), icon: .image(image), action: nil) context("identical parameters") { - let b = NavigationRow(title: "Same", subtitle: .belowTitle("Same"), icon: Icon(image: image), action: nil) + let b = NavigationRow(title: "Same", subtitle: .belowTitle("Same"), icon: .image(image), action: nil) it("should be equal") { expect(a) == b } } context("different titles") { - let c = NavigationRow(title: "Different", subtitle: .belowTitle("Same"), icon: Icon(image: image), action: nil) + let c = NavigationRow(title: "Different", subtitle: .belowTitle("Same"), icon: .image(image), action: nil) it("should not be equal") { expect(a) != c } } context("different subtitles") { - let d = NavigationRow(title: "Same", subtitle: .belowTitle("Different"), icon: Icon(image: image), action: nil) + let d = NavigationRow(title: "Same", subtitle: .belowTitle("Different"), icon: .image(image), action: nil) it("should not be equal") { expect(a) != d } } context("different icons") { - let e = NavigationRow(title: "Same", subtitle: .belowTitle("Same"), icon: Icon(image: UIImage()), action: nil) + let e = NavigationRow(title: "Same", subtitle: .belowTitle("Same"), icon: .image(UIImage()), action: nil) it("should not be equal") { expect(a) != e } } context("different actions") { - let f = NavigationRow(title: "Same", subtitle: .belowTitle("Same"), icon: Icon(image: image), action: { _ in }) + let f = NavigationRow(title: "Same", subtitle: .belowTitle("Same"), icon: .image(image), action: { _ in }) it("should be equal regardless the actions attached") { expect(a) == f } diff --git a/QuickTableViewControllerTests/OptionRowSpec.swift b/QuickTableViewControllerTests/OptionRowSpec.swift index fd80fed6..4dd34670 100644 --- a/QuickTableViewControllerTests/OptionRowSpec.swift +++ b/QuickTableViewControllerTests/OptionRowSpec.swift @@ -32,7 +32,7 @@ internal final class OptionRowSpec: QuickSpec { override func spec() { describe("initialiation") { - let icon = Icon(imageName: "icon") + let icon = Icon.named("icon") var invoked = false let row = OptionRow(title: "title", isSelected: true, icon: icon) { _ in invoked = true } @@ -82,7 +82,7 @@ internal final class OptionRowSpec: QuickSpec { } context("different icons") { - let e = OptionRow(title: "Same", isSelected: true, icon: Icon(image: UIImage()), action: nil) + let e = OptionRow(title: "Same", isSelected: true, icon: .image(UIImage()), action: nil) it("should not be equal") { expect(a) != e } diff --git a/QuickTableViewControllerTests/QuickTableViewDataSourceSpec.swift b/QuickTableViewControllerTests/QuickTableViewDataSourceSpec.swift index f7642769..d8927c72 100644 --- a/QuickTableViewControllerTests/QuickTableViewDataSourceSpec.swift +++ b/QuickTableViewControllerTests/QuickTableViewDataSourceSpec.swift @@ -157,15 +157,15 @@ internal final class QuickTableViewDataSourceSpec: QuickSpec { controller.tableContents = [ Section(title: "NavigationRow", rows: [ - CustomNavigationRow(title: "CellStyle.default", subtitle: .none, icon: Icon(imageName: "icon")), - CustomNavigationRow(title: "CellStyle", subtitle: .belowTitle(".subtitle"), icon: Icon(image: image)), - CustomNavigationRow(title: "CellStyle", subtitle: .rightAligned(".value1"), icon: Icon(image: image, highlightedImage: highlightedImage)), - CustomNavigationRow(title: "CellStyle", subtitle: .leftAligned(".value2"), icon: Icon(image: image)) + CustomNavigationRow(title: "CellStyle.default", subtitle: .none, icon: .named("icon")), + CustomNavigationRow(title: "CellStyle", subtitle: .belowTitle(".subtitle"), icon: .image(image)), + CustomNavigationRow(title: "CellStyle", subtitle: .rightAligned(".value1"), icon: .images(normal: image, highlighted: highlightedImage)), + CustomNavigationRow(title: "CellStyle", subtitle: .leftAligned(".value2"), icon: .image(image)) ]), Section(title: "SwitchRow", rows: [ - CustomSwitchRow(title: "imageName", switchValue: true, icon: Icon(imageName: "icon"), action: nil), - CustomSwitchRow(title: "image", switchValue: true, icon: Icon(image: image), action: nil), - CustomSwitchRow(title: "image + highlightedImage", switchValue: true, icon: Icon(image: image, highlightedImage: highlightedImage), action: nil) + CustomSwitchRow(title: "imageName", switchValue: true, icon: .named("icon"), action: nil), + CustomSwitchRow(title: "image", switchValue: true, icon: .image(image), action: nil), + CustomSwitchRow(title: "image + highlightedImage", switchValue: true, icon: .images(normal: image, highlighted: highlightedImage), action: nil) ]) ] diff --git a/QuickTableViewControllerTests/SwitchRowSpec.swift b/QuickTableViewControllerTests/SwitchRowSpec.swift index 68ba78af..4a033be9 100644 --- a/QuickTableViewControllerTests/SwitchRowSpec.swift +++ b/QuickTableViewControllerTests/SwitchRowSpec.swift @@ -71,7 +71,7 @@ internal final class SwitchRowSpec: QuickSpec { } context("different icons") { - let e = SwitchRow(title: "Same", switchValue: true, icon: Icon(image: UIImage()), action: nil) + let e = SwitchRow(title: "Same", switchValue: true, icon: .image(UIImage()), action: nil) it("should not be equal") { expect(a) != e } diff --git a/README.md b/README.md index 319c0fb4..128b53bd 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,9 @@ class ViewController: QuickTableViewController { ]), Section(title: "Navigation", rows: [ - NavigationRow(title: "CellStyle.default", subtitle: .none, icon: Icon(image: UIImage(named: "globe"), highlightedImage: UIImage(named: "globe-highlighted"))), - NavigationRow(title: "CellStyle", subtitle: .belowTitle(".subtitle"), icon: Icon(image: UIImage(named: "gear"))), - NavigationRow(title: "CellStyle", subtitle: .rightAligned(".value1"), icon: Icon(imageName: "time"), action: { [weak self] in self?.showDetail($0) }), + NavigationRow(title: "CellStyle.default", subtitle: .none, icon: .named("gear")), + NavigationRow(title: "CellStyle", subtitle: .belowTitle(".subtitle"), icon: .named("globe")), + NavigationRow(title: "CellStyle", subtitle: .rightAligned(".value1"), icon: .named("time"), action: { [weak self] in self?.showDetail($0) }), NavigationRow(title: "CellStyle", subtitle: .leftAligned(".value2")) ]), @@ -81,11 +81,12 @@ NavigationRow(title: "UITableViewCellStyle", subtitle: .leftAligned(".value2")) #### Images * Images in table view cells can be set by specifying the `icon` of each row. -* The `Icon` struct carries info about images for both normal and highlighted states. +* The `Icon` carries info about images for both normal and highlighted states. * Table view cells in `UITableViewCellStyle.value2` will not show the image view. ```swift -NavigationRow(title: "Cell with image", subtitle: .none, icon: Icon(imageName: "icon")) +let icon = Icon.images(normal: UIImage(named: "icon"), highlighted: UIImage(named: "icon-highlighted")) +NavigationRow(title: "Cell with image", subtitle: .none, icon: icon) ``` #### Disclosure Indicator diff --git a/Source/Model/Icon.swift b/Source/Model/Icon.swift index 45c40bcb..a931c5b5 100644 --- a/Source/Model/Icon.swift +++ b/Source/Model/Icon.swift @@ -27,51 +27,51 @@ import UIKit /// A struct that represents the image used in a row. -public struct Icon: Equatable { +public enum Icon: Equatable { - /// The image of the normal state. + /// Icon with an image of the given name for the normal state. + /// The "-highlighted" suffix is appended to the name for the highlighted image. + case named(String) + /// Icon with an image for the normal state. + case image(UIImage) + /// Icon with images for the normal and highlighted states. + case images(normal: UIImage, highlighted: UIImage) + + /// The image for the normal state. public var image: UIImage? { - return _image ?? imageName.flatMap(UIImage.init(named:)) + switch self { + case let .named(name): + return UIImage(named: name) + case let .image(image): + return image + case let .images(normal: image, highlighted: _): + return image + } } - /// The image of the highlighted state. + /// The image for the highlighted state. public var highlightedImage: UIImage? { - return - _highlightedImage ?? - (!highlightedImageName.isEmpty ? UIImage(named: highlightedImageName) : nil) - } - - fileprivate var _image: UIImage? - fileprivate var _highlightedImage: UIImage? - - public private(set) var imageName: String? - public var highlightedImageName: String { - if let name = imageName { - return name + "-highlighted" - } else { - return "" + switch self { + case let .named(name): + return UIImage(named: name + "-highlighted") + case .image: + return nil + case let .images(normal: _, highlighted: image): + return image } } - /// Initializes an icon with an image name. - public init(imageName: String) { - self.imageName = imageName - } - - /// Initializes an icon with images for the normal and highlighted states. - public init(image: UIImage, highlightedImage: UIImage? = nil) { - _image = image - _highlightedImage = highlightedImage - } - // MARK: Equatable - /// Returns true iff `lhs` and `rhs` have equal images, highlighted images and image names. + /// Returns true iff `lhs` and `rhs` have equal images and highlighted images. public static func == (lhs: Icon, rhs: Icon) -> Bool { - if let lhsName = lhs.imageName, let rhsName = rhs.imageName { - return lhsName == rhsName - } else { - return lhs._image == rhs._image && lhs._highlightedImage == rhs._highlightedImage + switch (lhs, rhs) { + case let (.named(left), .named(right)): + return left == right + default: + return + lhs.image == rhs.image && + lhs.highlightedImage == rhs.highlightedImage } } From d0b8b96a2b2970cdf686cde12d51eb3f7fe245b8 Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 22 Mar 2018 16:28:01 +0800 Subject: [PATCH 07/23] Rename the protocols that define specific rows regardless of their associated cell types --- CHANGELOG.md | 1 + .../CustomizationViewController.swift | 2 +- .../DefaultViewController.swift | 4 +-- .../project.pbxproj | 32 ++++++++++++------- .../QuickTableViewDelegateSpec.swift | 6 ++-- README.md | 2 +- Source/Model/OptionRow.swift | 4 +-- Source/Model/RadioSection.swift | 10 +++--- Source/Model/SwitchRow.swift | 4 +-- Source/Model/TapActionRow.swift | 2 +- Source/Protocol/NavigationRowCompatible.swift | 30 +++++++++++++++++ ...ctable.swift => OptionRowCompatible.swift} | 6 ++-- ...chable.swift => SwitchRowCompatible.swift} | 6 ++-- ...ble.swift => TapActionRowCompatible.swift} | 6 ++-- Source/QuickTableViewController.swift | 8 ++--- Source/View/SwitchCell.swift | 2 +- 16 files changed, 82 insertions(+), 43 deletions(-) create mode 100644 Source/Protocol/NavigationRowCompatible.swift rename Source/Protocol/{OptionSelectable.swift => OptionRowCompatible.swift} (86%) rename Source/Protocol/{Switchable.swift => SwitchRowCompatible.swift} (86%) rename Source/Protocol/{Tappable.swift => TapActionRowCompatible.swift} (85%) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1246aea..9b23d346 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ #### Breaking * Change the `Icon` type from struct to enum +* Rename the protocols that define specific rows regardless of their associated cell types ## v0.8.4 diff --git a/Example/ViewControllers/CustomizationViewController.swift b/Example/ViewControllers/CustomizationViewController.swift index d9c88a6a..ba6d21d0 100644 --- a/Example/ViewControllers/CustomizationViewController.swift +++ b/Example/ViewControllers/CustomizationViewController.swift @@ -97,7 +97,7 @@ internal final class CustomizationViewController: QuickTableViewController { // MARK: - Private private func log(_ sender: Row) { - if let option = sender as? OptionSelectable, !option.isSelected { + if let option = sender as? OptionRowCompatible, !option.isSelected { return } diff --git a/Example/ViewControllers/DefaultViewController.swift b/Example/ViewControllers/DefaultViewController.swift index 70d8268e..1696725b 100644 --- a/Example/ViewControllers/DefaultViewController.swift +++ b/Example/ViewControllers/DefaultViewController.swift @@ -82,7 +82,7 @@ internal final class DefaultViewController: QuickTableViewController { // MARK: - Private Methods private func didToggleSelection(_ sender: Row) { - guard let option = sender as? OptionSelectable else { + guard let option = sender as? OptionRowCompatible else { return } let state = "\(option.title) is " + (option.isSelected ? "selected" : "deselected") @@ -91,7 +91,7 @@ internal final class DefaultViewController: QuickTableViewController { } private func didToggleSwitch(_ sender: Row) { - if let row = sender as? Switchable { + if let row = sender as? SwitchRowCompatible { let state = "\(row.title) = \(row.switchValue)" print(state) showDebuggingText(state) diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 551ba3c8..171f759f 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -24,9 +24,9 @@ B5334F191B8CC5BD00C64A6D /* QuickTableViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; B5334F301B8CC6AA00C64A6D /* QuickTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */; }; B536C7F81F4AAF9900DAC4AA /* ReusableSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B536C7F61F4AAF7C00DAC4AA /* ReusableSpec.swift */; }; - B5374C901FDD7AF800A3EA28 /* OptionSelectable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5374C8F1FDD7AF700A3EA28 /* OptionSelectable.swift */; }; - B5374C931FDD7B3E00A3EA28 /* Switchable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5374C911FDD7B3D00A3EA28 /* Switchable.swift */; }; - B5374C941FDD7B3E00A3EA28 /* Tappable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5374C921FDD7B3E00A3EA28 /* Tappable.swift */; }; + B5374C901FDD7AF800A3EA28 /* OptionRowCompatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5374C8F1FDD7AF700A3EA28 /* OptionRowCompatible.swift */; }; + B5374C931FDD7B3E00A3EA28 /* SwitchRowCompatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5374C911FDD7B3D00A3EA28 /* SwitchRowCompatible.swift */; }; + B5374C941FDD7B3E00A3EA28 /* TapActionRowCompatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5374C921FDD7B3E00A3EA28 /* TapActionRowCompatible.swift */; }; B55475751F2DC3C00027F7C1 /* Configurable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B55475741F2DC3C00027F7C1 /* Configurable.swift */; }; B578B5091C5673240021F7C3 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B578B5071C5673240021F7C3 /* icon.png */; }; B578B50A1C5673240021F7C3 /* icon-highlighted.png in Resources */ = {isa = PBXBuildFile; fileRef = B578B5081C5673240021F7C3 /* icon-highlighted.png */; }; @@ -46,6 +46,7 @@ B5DB7D311C4B9ACB007B84D2 /* TapActionRowSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DB7D301C4B9ACB007B84D2 /* TapActionRowSpec.swift */; }; B5DB7D351C4CBB74007B84D2 /* SectionSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DB7D341C4CBB74007B84D2 /* SectionSpec.swift */; }; B5DB94351BE117EE00E2CEDE /* SubtitleSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DB94341BE117EE00E2CEDE /* SubtitleSpec.swift */; }; + B5DD432B20639E1400AB661D /* NavigationRowCompatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DD432A20639E1400AB661D /* NavigationRowCompatible.swift */; }; B5E029211DC7A39200B5C90E /* Section.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E029201DC7A39200B5C90E /* Section.swift */; }; B5E029231DC8B3EC00B5C90E /* Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E029221DC8B3EC00B5C90E /* Icon.swift */; }; B5E619CF1F454CF0005200E1 /* RadioSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E619CE1F454CF0005200E1 /* RadioSection.swift */; }; @@ -124,9 +125,9 @@ B5334F241B8CC5BD00C64A6D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = QuickTableViewController.swift; path = Source/QuickTableViewController.swift; sourceTree = SOURCE_ROOT; }; B536C7F61F4AAF7C00DAC4AA /* ReusableSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReusableSpec.swift; sourceTree = ""; }; - B5374C8F1FDD7AF700A3EA28 /* OptionSelectable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OptionSelectable.swift; path = Source/Protocol/OptionSelectable.swift; sourceTree = SOURCE_ROOT; }; - B5374C911FDD7B3D00A3EA28 /* Switchable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Switchable.swift; path = Source/Protocol/Switchable.swift; sourceTree = SOURCE_ROOT; }; - B5374C921FDD7B3E00A3EA28 /* Tappable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Tappable.swift; path = Source/Protocol/Tappable.swift; sourceTree = SOURCE_ROOT; }; + B5374C8F1FDD7AF700A3EA28 /* OptionRowCompatible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OptionRowCompatible.swift; path = Source/Protocol/OptionRowCompatible.swift; sourceTree = SOURCE_ROOT; }; + B5374C911FDD7B3D00A3EA28 /* SwitchRowCompatible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwitchRowCompatible.swift; path = Source/Protocol/SwitchRowCompatible.swift; sourceTree = SOURCE_ROOT; }; + B5374C921FDD7B3E00A3EA28 /* TapActionRowCompatible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TapActionRowCompatible.swift; path = Source/Protocol/TapActionRowCompatible.swift; sourceTree = SOURCE_ROOT; }; B55475741F2DC3C00027F7C1 /* Configurable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Configurable.swift; path = Source/Protocol/Configurable.swift; sourceTree = SOURCE_ROOT; }; B578B5071C5673240021F7C3 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; B578B5081C5673240021F7C3 /* icon-highlighted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-highlighted.png"; sourceTree = ""; }; @@ -147,6 +148,9 @@ B5DB7D301C4B9ACB007B84D2 /* TapActionRowSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TapActionRowSpec.swift; sourceTree = ""; }; B5DB7D341C4CBB74007B84D2 /* SectionSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SectionSpec.swift; sourceTree = ""; }; B5DB94341BE117EE00E2CEDE /* SubtitleSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubtitleSpec.swift; sourceTree = ""; }; + B5DD432A20639E1400AB661D /* NavigationRowCompatible.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NavigationRowCompatible.swift; path = Source/Protocol/NavigationRowCompatible.swift; sourceTree = SOURCE_ROOT; }; + B5DD432C20639F7800AB661D /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = ""; }; + B5DD432D20639F7800AB661D /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; B5E029201DC7A39200B5C90E /* Section.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Section.swift; path = Source/Model/Section.swift; sourceTree = SOURCE_ROOT; }; B5E029221DC8B3EC00B5C90E /* Icon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Icon.swift; path = Source/Model/Icon.swift; sourceTree = SOURCE_ROOT; }; B5E619CE1F454CF0005200E1 /* RadioSection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RadioSection.swift; path = Source/Model/RadioSection.swift; sourceTree = SOURCE_ROOT; }; @@ -223,12 +227,13 @@ isa = PBXGroup; children = ( B55475741F2DC3C00027F7C1 /* Configurable.swift */, - B5374C8F1FDD7AF700A3EA28 /* OptionSelectable.swift */, + B5DD432A20639E1400AB661D /* NavigationRowCompatible.swift */, + B5374C8F1FDD7AF700A3EA28 /* OptionRowCompatible.swift */, B522E1DF1F4AA750004DA5AD /* Reusable.swift */, B5EC18221B95FD7F0015C665 /* Row.swift */, B50E73841F2E1BC900481910 /* RowStyle.swift */, - B5374C911FDD7B3D00A3EA28 /* Switchable.swift */, - B5374C921FDD7B3E00A3EA28 /* Tappable.swift */, + B5374C911FDD7B3D00A3EA28 /* SwitchRowCompatible.swift */, + B5374C921FDD7B3E00A3EA28 /* TapActionRowCompatible.swift */, ); name = Protocol; sourceTree = ""; @@ -265,6 +270,8 @@ B5334F141B8CC5BD00C64A6D /* Products */, B5334F151B8CC5BD00C64A6D /* QuickTableViewController */, B5334F221B8CC5BD00C64A6D /* QuickTableViewControllerTests */, + B5DD432C20639F7800AB661D /* CHANGELOG.md */, + B5DD432D20639F7800AB661D /* README.md */, ); indentWidth = 2; sourceTree = ""; @@ -753,8 +760,9 @@ B55475751F2DC3C00027F7C1 /* Configurable.swift in Sources */, B5E029231DC8B3EC00B5C90E /* Icon.swift in Sources */, B5F0FFE81E9CC6E8007BF1C9 /* NavigationRow.swift in Sources */, + B5DD432B20639E1400AB661D /* NavigationRowCompatible.swift in Sources */, B5E619D21F454EEF005200E1 /* OptionRow.swift in Sources */, - B5374C901FDD7AF800A3EA28 /* OptionSelectable.swift in Sources */, + B5374C901FDD7AF800A3EA28 /* OptionRowCompatible.swift in Sources */, B5334F301B8CC6AA00C64A6D /* QuickTableViewController.swift in Sources */, B5E619CF1F454CF0005200E1 /* RadioSection.swift in Sources */, B522E1E01F4AA750004DA5AD /* Reusable.swift in Sources */, @@ -762,12 +770,12 @@ B50E73851F2E1BC900481910 /* RowStyle.swift in Sources */, B5E029211DC7A39200B5C90E /* Section.swift in Sources */, B5F0FFEE1E9CC73D007BF1C9 /* Subtitle.swift in Sources */, - B5374C931FDD7B3E00A3EA28 /* Switchable.swift in Sources */, B5F0FFE61E9CC69C007BF1C9 /* SwitchCell.swift in Sources */, B5F0FFEA1E9CC6F9007BF1C9 /* SwitchRow.swift in Sources */, + B5374C931FDD7B3E00A3EA28 /* SwitchRowCompatible.swift in Sources */, B595627B1B9758BC00D6DAB1 /* TapActionCell.swift in Sources */, B5F0FFEC1E9CC72D007BF1C9 /* TapActionRow.swift in Sources */, - B5374C941FDD7B3E00A3EA28 /* Tappable.swift in Sources */, + B5374C941FDD7B3E00A3EA28 /* TapActionRowCompatible.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/QuickTableViewControllerTests/QuickTableViewDelegateSpec.swift b/QuickTableViewControllerTests/QuickTableViewDelegateSpec.swift index 93a6b132..b2438666 100644 --- a/QuickTableViewControllerTests/QuickTableViewDelegateSpec.swift +++ b/QuickTableViewControllerTests/QuickTableViewDelegateSpec.swift @@ -194,7 +194,7 @@ internal final class QuickTableViewDelegateSpec: QuickSpec { controller.tableView(controller.tableView, didSelectRowAt: IndexPath(row: index, section: 0)) expect(toggledIndex).toEventually(equal(index)) - let option = section.rows[index] as? OptionSelectable + let option = section.rows[index] as? OptionRowCompatible expect(option?.isSelected) == true } } @@ -222,7 +222,7 @@ internal final class QuickTableViewDelegateSpec: QuickSpec { controller.tableView(controller.tableView, didSelectRowAt: IndexPath(row: index, section: 0)) expect(toggledIndex).toEventually(equal(index)) - let option = radio.rows[index] as? OptionSelectable + let option = radio.rows[index] as? OptionRowCompatible expect(option?.isSelected) == true controller.tableView(controller.tableView, didSelectRowAt: IndexPath(row: index, section: 0)) @@ -250,7 +250,7 @@ internal final class QuickTableViewDelegateSpec: QuickSpec { controller.tableView(controller.tableView, didSelectRowAt: IndexPath(row: index, section: 0)) expect(toggledIndex).toEventually(equal(index)) - let option = controller.tableContents[0].rows[index] as? OptionSelectable + let option = controller.tableContents[0].rows[index] as? OptionRowCompatible expect(option?.isSelected) == true controller.tableView(controller.tableView, didSelectRowAt: IndexPath(row: index, section: 0)) diff --git a/README.md b/README.md index 128b53bd..cf3305c2 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,7 @@ let action: (Row) -> Void = { switch $0 { case let option as OptionRow: // only matches the option rows with a specific cell type - case let option as OptionSelectable: + case let option as OptionRowCompatible: // matches all option rows default: break diff --git a/Source/Model/OptionRow.swift b/Source/Model/OptionRow.swift index 98bcf851..dbb0572d 100644 --- a/Source/Model/OptionRow.swift +++ b/Source/Model/OptionRow.swift @@ -27,7 +27,7 @@ import UIKit /// A class that represents a row of selectable option. -open class OptionRow: OptionSelectable, Equatable { +open class OptionRow: OptionRowCompatible, Equatable { // MARK: - Initializer @@ -47,7 +47,7 @@ open class OptionRow: OptionSelectable, Equatable { self.action = action } - // MARK: - OptionSelectable + // MARK: - OptionRowCompatible /// The state of selection. public var isSelected: Bool = false { diff --git a/Source/Model/RadioSection.swift b/Source/Model/RadioSection.swift index 3b653c3b..d09228f5 100644 --- a/Source/Model/RadioSection.swift +++ b/Source/Model/RadioSection.swift @@ -32,7 +32,7 @@ open class RadioSection: Section { // MARK: - Initializer /// Initializes a section with a title, containing rows and an optional footer. - public init(title: String?, options: [OptionSelectable], footer: String? = nil) { + public init(title: String?, options: [OptionRowCompatible], footer: String? = nil) { self.options = options super.init(title: title, rows: [], footer: footer) } @@ -49,7 +49,7 @@ open class RadioSection: Section { return options } set { - options = rows as? [OptionSelectable] ?? options + options = rows as? [OptionRowCompatible] ?? options } } @@ -65,7 +65,7 @@ open class RadioSection: Section { } /// The array of options in the section. It's identical to the `rows`. - open private(set) var options: [OptionSelectable] + open private(set) var options: [OptionRowCompatible] /// Returns the selected index, or nil when nothing is selected. open var indexOfSelectedOption: Int? { @@ -73,7 +73,7 @@ open class RadioSection: Section { } /// Returns the selected option row, or nil when nothing is selected. - open var selectedOption: OptionSelectable? { + open var selectedOption: OptionRowCompatible? { if let index = indexOfSelectedOption { return options[index] } else { @@ -86,7 +86,7 @@ open class RadioSection: Section { /// /// - Parameter option: The option to flip the `isSelected` state. /// - Returns: The indexes of changed options. - open func toggle(_ option: OptionSelectable) -> IndexSet { + open func toggle(_ option: OptionRowCompatible) -> IndexSet { if option.isSelected && alwaysSelectsOneOption { return [] } diff --git a/Source/Model/SwitchRow.swift b/Source/Model/SwitchRow.swift index 7907470a..4fc0576d 100644 --- a/Source/Model/SwitchRow.swift +++ b/Source/Model/SwitchRow.swift @@ -27,7 +27,7 @@ import UIKit /// A class that represents a row with a switch. -open class SwitchRow: Switchable, Equatable { +open class SwitchRow: SwitchRowCompatible, Equatable { // MARK: - Initializer @@ -47,7 +47,7 @@ open class SwitchRow: Switchable, Equatable { self.action = action } - // MARK: - Switchable + // MARK: - SwitchRowCompatible /// The state of the switch. public var switchValue: Bool = false { diff --git a/Source/Model/TapActionRow.swift b/Source/Model/TapActionRow.swift index 0216856c..50a5bf2d 100644 --- a/Source/Model/TapActionRow.swift +++ b/Source/Model/TapActionRow.swift @@ -27,7 +27,7 @@ import UIKit /// A class that represents a row that triggers certain action when selected. -open class TapActionRow: Tappable, Equatable { +open class TapActionRow: TapActionRowCompatible, Equatable { // MARK: - Initializer diff --git a/Source/Protocol/NavigationRowCompatible.swift b/Source/Protocol/NavigationRowCompatible.swift new file mode 100644 index 00000000..54cf0302 --- /dev/null +++ b/Source/Protocol/NavigationRowCompatible.swift @@ -0,0 +1,30 @@ +// +// NavigationRowCompatible.swift +// QuickTableViewController +// +// Created by Ben on 22/03/2018. +// Copyright © 2018 bcylin. +// +// 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 Foundation + +/// This protocol defines the compatible interface of a `NavigationRow` regardless of its associated cell type. +public protocol NavigationRowCompatible: class, Row, RowStyle {} diff --git a/Source/Protocol/OptionSelectable.swift b/Source/Protocol/OptionRowCompatible.swift similarity index 86% rename from Source/Protocol/OptionSelectable.swift rename to Source/Protocol/OptionRowCompatible.swift index 4868bde1..76c0382d 100644 --- a/Source/Protocol/OptionSelectable.swift +++ b/Source/Protocol/OptionRowCompatible.swift @@ -1,5 +1,5 @@ // -// OptionSelectable.swift +// OptionRowCompatible.swift // QuickTableViewController // // Created by Ben on 10/12/2017. @@ -26,8 +26,8 @@ import Foundation -/// Any type that conforms to this protocol is compatible with `RadioSection`. -public protocol OptionSelectable: class, Row, RowStyle { +/// This protocol defines the compatible interface of an `OptionRow` regardless of its associated cell type. +public protocol OptionRowCompatible: class, Row, RowStyle { /// The state of selection. var isSelected: Bool { get set } diff --git a/Source/Protocol/Switchable.swift b/Source/Protocol/SwitchRowCompatible.swift similarity index 86% rename from Source/Protocol/Switchable.swift rename to Source/Protocol/SwitchRowCompatible.swift index 96fae59a..f7cf4210 100644 --- a/Source/Protocol/Switchable.swift +++ b/Source/Protocol/SwitchRowCompatible.swift @@ -1,5 +1,5 @@ // -// Switchable.swift +// SwitchRowCompatible.swift // QuickTableViewController // // Created by Ben on 10/12/2017. @@ -26,8 +26,8 @@ import Foundation -/// Any type that conforms to this protocol is compatible `SwitchCell`. -public protocol Switchable: class, Row, RowStyle { +/// This protocol defines the compatible interface of a `SwitchRow` regardless of its associated cell type. +public protocol SwitchRowCompatible: class, Row, RowStyle { /// The state of the switch. var switchValue: Bool { get set } diff --git a/Source/Protocol/Tappable.swift b/Source/Protocol/TapActionRowCompatible.swift similarity index 85% rename from Source/Protocol/Tappable.swift rename to Source/Protocol/TapActionRowCompatible.swift index 87441512..f70896de 100644 --- a/Source/Protocol/Tappable.swift +++ b/Source/Protocol/TapActionRowCompatible.swift @@ -1,5 +1,5 @@ // -// Tappable.swift +// TapActionRowCompatible.swift // QuickTableViewController // // Created by Ben on 10/12/2017. @@ -26,5 +26,5 @@ import Foundation -/// An empty type that indicates it's compatible with `TapActionCell`. -public protocol Tappable: Row, RowStyle {} +/// This protocol defines the compatible interface of a `TapActionRow` regardless of its associated cell type. +public protocol TapActionRowCompatible: Row, RowStyle {} diff --git a/Source/QuickTableViewController.swift b/Source/QuickTableViewController.swift index 542dccbc..e5d59c23 100644 --- a/Source/QuickTableViewController.swift +++ b/Source/QuickTableViewController.swift @@ -127,7 +127,7 @@ open class QuickTableViewController: UIViewController, let row = section.rows[indexPath.row] switch (section, row) { - case let (radio as RadioSection, option as OptionSelectable): + case let (radio as RadioSection, option as OptionRowCompatible): let changes: [IndexPath] = radio.toggle(option).map { IndexPath(row: $0, section: indexPath.section) } @@ -137,12 +137,12 @@ open class QuickTableViewController: UIViewController, tableView.reloadData() } - case let (_, option as OptionSelectable): + case let (_, option as OptionRowCompatible): // Allow OptionRow to be used without RadioSection. option.isSelected = !option.isSelected tableView.reloadData() - case (_, is Tappable): + case (_, is TapActionRowCompatible): tableView.deselectRow(at: indexPath, animated: true) DispatchQueue.main.async { row.action?(row) @@ -164,7 +164,7 @@ open class QuickTableViewController: UIViewController, open func switchCell(_ cell: SwitchCell, didToggleSwitch isOn: Bool) { guard let indexPath = tableView.indexPath(for: cell), - let row = tableContents[indexPath.section].rows[indexPath.row] as? Switchable + let row = tableContents[indexPath.section].rows[indexPath.row] as? SwitchRowCompatible else { return } diff --git a/Source/View/SwitchCell.swift b/Source/View/SwitchCell.swift index 8996b7ff..b2b30f64 100644 --- a/Source/View/SwitchCell.swift +++ b/Source/View/SwitchCell.swift @@ -77,7 +77,7 @@ open class SwitchCell: UITableViewCell, Configurable { /// Set up the switch control with the provided row. open func configure(with row: Row & RowStyle) { - if let row = row as? Switchable { + if let row = row as? SwitchRowCompatible { switchControl.isOn = row.switchValue } accessoryView = switchControl From a54332e99d98df8926f7ad7a2ff2872d3215df01 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 26 Mar 2018 21:35:26 +0800 Subject: [PATCH 08/23] Rearrange the files for tests --- .../project.pbxproj | 96 ++++++++++-------- .../{ => Assets}/icon-highlighted.png | Bin .../{ => Assets}/icon.png | Bin .../{ => Model}/IconSpec.swift | 0 .../{ => Model}/RadioSectionSpec.swift | 0 .../{ => Model}/SectionSpec.swift | 0 .../{ => Model}/SubtitleSpec.swift | 0 .../{ => Row}/NavigationRowSpec.swift | 0 .../{ => Row}/OptionRowSpec.swift | 0 .../{ => Row}/SwitchRowSpec.swift | 0 .../{ => Row}/TapActionRowSpec.swift | 0 .../{ => View}/ConfigurableSpec.swift | 0 .../{ => View}/ReusableSpec.swift | 0 .../QuickTableViewControllerSpec.swift | 0 .../QuickTableViewDataSourceSpec.swift | 0 .../QuickTableViewDelegateSpec.swift | 0 16 files changed, 56 insertions(+), 40 deletions(-) rename QuickTableViewControllerTests/{ => Assets}/icon-highlighted.png (100%) rename QuickTableViewControllerTests/{ => Assets}/icon.png (100%) rename QuickTableViewControllerTests/{ => Model}/IconSpec.swift (100%) rename QuickTableViewControllerTests/{ => Model}/RadioSectionSpec.swift (100%) rename QuickTableViewControllerTests/{ => Model}/SectionSpec.swift (100%) rename QuickTableViewControllerTests/{ => Model}/SubtitleSpec.swift (100%) rename QuickTableViewControllerTests/{ => Row}/NavigationRowSpec.swift (100%) rename QuickTableViewControllerTests/{ => Row}/OptionRowSpec.swift (100%) rename QuickTableViewControllerTests/{ => Row}/SwitchRowSpec.swift (100%) rename QuickTableViewControllerTests/{ => Row}/TapActionRowSpec.swift (100%) rename QuickTableViewControllerTests/{ => View}/ConfigurableSpec.swift (100%) rename QuickTableViewControllerTests/{ => View}/ReusableSpec.swift (100%) rename QuickTableViewControllerTests/{ => ViewController}/QuickTableViewControllerSpec.swift (100%) rename QuickTableViewControllerTests/{ => ViewController}/QuickTableViewDataSourceSpec.swift (100%) rename QuickTableViewControllerTests/{ => ViewController}/QuickTableViewDelegateSpec.swift (100%) diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 171f759f..0dc29dc5 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -238,6 +238,56 @@ name = Protocol; sourceTree = ""; }; + B51A0E2D20692AFD00F42693 /* View */ = { + isa = PBXGroup; + children = ( + B5824E8A1FF3B639009666C8 /* ConfigurableSpec.swift */, + B536C7F61F4AAF7C00DAC4AA /* ReusableSpec.swift */, + ); + path = View; + sourceTree = ""; + }; + B51A0E2E20692B1100F42693 /* Model */ = { + isa = PBXGroup; + children = ( + B5DB7D251C4B7F0E007B84D2 /* IconSpec.swift */, + B5E619D61F4589F7005200E1 /* RadioSectionSpec.swift */, + B5DB7D341C4CBB74007B84D2 /* SectionSpec.swift */, + B5DB94341BE117EE00E2CEDE /* SubtitleSpec.swift */, + ); + path = Model; + sourceTree = ""; + }; + B51A0E3020692B4100F42693 /* ViewController */ = { + isa = PBXGroup; + children = ( + B57FAA6C1C512D5B008FF7C7 /* QuickTableViewControllerSpec.swift */, + B52677741FF80E9100DC1362 /* QuickTableViewDataSourceSpec.swift */, + B52677721FF7F08D00DC1362 /* QuickTableViewDelegateSpec.swift */, + ); + path = ViewController; + sourceTree = ""; + }; + B51A0E3220692D7B00F42693 /* Row */ = { + isa = PBXGroup; + children = ( + B5DB7D2C1C4B8294007B84D2 /* NavigationRowSpec.swift */, + B5E619D31F45708F005200E1 /* OptionRowSpec.swift */, + B5DB7D2E1C4B95D3007B84D2 /* SwitchRowSpec.swift */, + B5DB7D301C4B9ACB007B84D2 /* TapActionRowSpec.swift */, + ); + path = Row; + sourceTree = ""; + }; + B51A0E3320692E7100F42693 /* Assets */ = { + isa = PBXGroup; + children = ( + B578B5081C5673240021F7C3 /* icon-highlighted.png */, + B578B5071C5673240021F7C3 /* icon.png */, + ); + path = Assets; + sourceTree = ""; + }; B51F21A31F417037009BC2C9 /* Example */ = { isa = PBXGroup; children = ( @@ -315,25 +365,15 @@ B5334F221B8CC5BD00C64A6D /* QuickTableViewControllerTests */ = { isa = PBXGroup; children = ( - B5DB7D331C4BA0E8007B84D2 /* ModelSpecs */, - B5DB7D321C4B9FE6007B84D2 /* RowSpecs */, - B5334F231B8CC5BD00C64A6D /* Supporting Files */, + B51A0E3320692E7100F42693 /* Assets */, + B51A0E2E20692B1100F42693 /* Model */, + B51A0E3220692D7B00F42693 /* Row */, + B51A0E2D20692AFD00F42693 /* View */, + B51A0E3020692B4100F42693 /* ViewController */, B526776F1FF7EA5A00DC1362 /* CustomTypes.swift */, - B57FAA6C1C512D5B008FF7C7 /* QuickTableViewControllerSpec.swift */, - B52677741FF80E9100DC1362 /* QuickTableViewDataSourceSpec.swift */, - B52677721FF7F08D00DC1362 /* QuickTableViewDelegateSpec.swift */, - ); - path = QuickTableViewControllerTests; - sourceTree = ""; - }; - B5334F231B8CC5BD00C64A6D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - B578B5081C5673240021F7C3 /* icon-highlighted.png */, - B578B5071C5673240021F7C3 /* icon.png */, B5334F241B8CC5BD00C64A6D /* Info.plist */, ); - name = "Supporting Files"; + path = QuickTableViewControllerTests; sourceTree = ""; }; B55475721F2DC29B0027F7C1 /* Model */ = { @@ -387,30 +427,6 @@ name = Frameworks; sourceTree = ""; }; - B5DB7D321C4B9FE6007B84D2 /* RowSpecs */ = { - isa = PBXGroup; - children = ( - B5824E8A1FF3B639009666C8 /* ConfigurableSpec.swift */, - B5DB7D2C1C4B8294007B84D2 /* NavigationRowSpec.swift */, - B5E619D31F45708F005200E1 /* OptionRowSpec.swift */, - B5DB7D2E1C4B95D3007B84D2 /* SwitchRowSpec.swift */, - B5DB7D301C4B9ACB007B84D2 /* TapActionRowSpec.swift */, - ); - name = RowSpecs; - sourceTree = ""; - }; - B5DB7D331C4BA0E8007B84D2 /* ModelSpecs */ = { - isa = PBXGroup; - children = ( - B5DB7D251C4B7F0E007B84D2 /* IconSpec.swift */, - B5E619D61F4589F7005200E1 /* RadioSectionSpec.swift */, - B536C7F61F4AAF7C00DAC4AA /* ReusableSpec.swift */, - B5DB7D341C4CBB74007B84D2 /* SectionSpec.swift */, - B5DB94341BE117EE00E2CEDE /* SubtitleSpec.swift */, - ); - name = ModelSpecs; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ diff --git a/QuickTableViewControllerTests/icon-highlighted.png b/QuickTableViewControllerTests/Assets/icon-highlighted.png similarity index 100% rename from QuickTableViewControllerTests/icon-highlighted.png rename to QuickTableViewControllerTests/Assets/icon-highlighted.png diff --git a/QuickTableViewControllerTests/icon.png b/QuickTableViewControllerTests/Assets/icon.png similarity index 100% rename from QuickTableViewControllerTests/icon.png rename to QuickTableViewControllerTests/Assets/icon.png diff --git a/QuickTableViewControllerTests/IconSpec.swift b/QuickTableViewControllerTests/Model/IconSpec.swift similarity index 100% rename from QuickTableViewControllerTests/IconSpec.swift rename to QuickTableViewControllerTests/Model/IconSpec.swift diff --git a/QuickTableViewControllerTests/RadioSectionSpec.swift b/QuickTableViewControllerTests/Model/RadioSectionSpec.swift similarity index 100% rename from QuickTableViewControllerTests/RadioSectionSpec.swift rename to QuickTableViewControllerTests/Model/RadioSectionSpec.swift diff --git a/QuickTableViewControllerTests/SectionSpec.swift b/QuickTableViewControllerTests/Model/SectionSpec.swift similarity index 100% rename from QuickTableViewControllerTests/SectionSpec.swift rename to QuickTableViewControllerTests/Model/SectionSpec.swift diff --git a/QuickTableViewControllerTests/SubtitleSpec.swift b/QuickTableViewControllerTests/Model/SubtitleSpec.swift similarity index 100% rename from QuickTableViewControllerTests/SubtitleSpec.swift rename to QuickTableViewControllerTests/Model/SubtitleSpec.swift diff --git a/QuickTableViewControllerTests/NavigationRowSpec.swift b/QuickTableViewControllerTests/Row/NavigationRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests/NavigationRowSpec.swift rename to QuickTableViewControllerTests/Row/NavigationRowSpec.swift diff --git a/QuickTableViewControllerTests/OptionRowSpec.swift b/QuickTableViewControllerTests/Row/OptionRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests/OptionRowSpec.swift rename to QuickTableViewControllerTests/Row/OptionRowSpec.swift diff --git a/QuickTableViewControllerTests/SwitchRowSpec.swift b/QuickTableViewControllerTests/Row/SwitchRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests/SwitchRowSpec.swift rename to QuickTableViewControllerTests/Row/SwitchRowSpec.swift diff --git a/QuickTableViewControllerTests/TapActionRowSpec.swift b/QuickTableViewControllerTests/Row/TapActionRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests/TapActionRowSpec.swift rename to QuickTableViewControllerTests/Row/TapActionRowSpec.swift diff --git a/QuickTableViewControllerTests/ConfigurableSpec.swift b/QuickTableViewControllerTests/View/ConfigurableSpec.swift similarity index 100% rename from QuickTableViewControllerTests/ConfigurableSpec.swift rename to QuickTableViewControllerTests/View/ConfigurableSpec.swift diff --git a/QuickTableViewControllerTests/ReusableSpec.swift b/QuickTableViewControllerTests/View/ReusableSpec.swift similarity index 100% rename from QuickTableViewControllerTests/ReusableSpec.swift rename to QuickTableViewControllerTests/View/ReusableSpec.swift diff --git a/QuickTableViewControllerTests/QuickTableViewControllerSpec.swift b/QuickTableViewControllerTests/ViewController/QuickTableViewControllerSpec.swift similarity index 100% rename from QuickTableViewControllerTests/QuickTableViewControllerSpec.swift rename to QuickTableViewControllerTests/ViewController/QuickTableViewControllerSpec.swift diff --git a/QuickTableViewControllerTests/QuickTableViewDataSourceSpec.swift b/QuickTableViewControllerTests/ViewController/QuickTableViewDataSourceSpec.swift similarity index 100% rename from QuickTableViewControllerTests/QuickTableViewDataSourceSpec.swift rename to QuickTableViewControllerTests/ViewController/QuickTableViewDataSourceSpec.swift diff --git a/QuickTableViewControllerTests/QuickTableViewDelegateSpec.swift b/QuickTableViewControllerTests/ViewController/QuickTableViewDelegateSpec.swift similarity index 100% rename from QuickTableViewControllerTests/QuickTableViewDelegateSpec.swift rename to QuickTableViewControllerTests/ViewController/QuickTableViewDelegateSpec.swift From c6beb82f986347f2472fb57b467d7f0fda071fa3 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 26 Mar 2018 22:01:19 +0800 Subject: [PATCH 09/23] Rename the directory to QuickTableViewController-iOS --- .../Info.plist | 0 .../QuickTableViewController.h | 0 .../project.pbxproj | 38 +++++++----------- .../Assets/icon-highlighted.png | Bin .../Assets/icon.png | Bin .../CustomTypes.swift | 0 .../Info.plist | 0 .../Model/IconSpec.swift | 0 .../Model/RadioSectionSpec.swift | 0 .../Model/SectionSpec.swift | 0 .../Model/SubtitleSpec.swift | 0 .../Row/NavigationRowSpec.swift | 0 .../Row/OptionRowSpec.swift | 0 .../Row/SwitchRowSpec.swift | 0 .../Row/TapActionRowSpec.swift | 0 .../View/ConfigurableSpec.swift | 0 .../View/ReusableSpec.swift | 0 .../QuickTableViewControllerSpec.swift | 0 .../QuickTableViewDataSourceSpec.swift | 0 .../QuickTableViewDelegateSpec.swift | 0 20 files changed, 15 insertions(+), 23 deletions(-) rename {QuickTableViewController => QuickTableViewController-iOS}/Info.plist (100%) rename {QuickTableViewController => QuickTableViewController-iOS}/QuickTableViewController.h (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Assets/icon-highlighted.png (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Assets/icon.png (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/CustomTypes.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Info.plist (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Model/IconSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Model/RadioSectionSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Model/SectionSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Model/SubtitleSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Row/NavigationRowSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Row/OptionRowSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Row/SwitchRowSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/Row/TapActionRowSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/View/ConfigurableSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/View/ReusableSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/ViewController/QuickTableViewControllerSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/ViewController/QuickTableViewDataSourceSpec.swift (100%) rename {QuickTableViewControllerTests => QuickTableViewControllerTests-iOS}/ViewController/QuickTableViewDelegateSpec.swift (100%) diff --git a/QuickTableViewController/Info.plist b/QuickTableViewController-iOS/Info.plist similarity index 100% rename from QuickTableViewController/Info.plist rename to QuickTableViewController-iOS/Info.plist diff --git a/QuickTableViewController/QuickTableViewController.h b/QuickTableViewController-iOS/QuickTableViewController.h similarity index 100% rename from QuickTableViewController/QuickTableViewController.h rename to QuickTableViewController-iOS/QuickTableViewController.h diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 0dc29dc5..836e1e3d 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -119,8 +119,8 @@ B52677721FF7F08D00DC1362 /* QuickTableViewDelegateSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickTableViewDelegateSpec.swift; sourceTree = ""; }; B52677741FF80E9100DC1362 /* QuickTableViewDataSourceSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickTableViewDataSourceSpec.swift; sourceTree = ""; }; B5334F131B8CC5BD00C64A6D /* QuickTableViewController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = QuickTableViewController.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B5334F171B8CC5BD00C64A6D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = QuickTableViewController/Info.plist; sourceTree = SOURCE_ROOT; }; - B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = QuickTableViewController.h; path = QuickTableViewController/QuickTableViewController.h; sourceTree = SOURCE_ROOT; }; + B5334F171B8CC5BD00C64A6D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = "QuickTableViewController-iOS/Info.plist"; sourceTree = SOURCE_ROOT; }; + B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = QuickTableViewController.h; path = "QuickTableViewController-iOS/QuickTableViewController.h"; sourceTree = SOURCE_ROOT; }; B5334F1E1B8CC5BD00C64A6D /* QuickTableViewControllerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = QuickTableViewControllerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; B5334F241B8CC5BD00C64A6D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = QuickTableViewController.swift; path = Source/QuickTableViewController.swift; sourceTree = SOURCE_ROOT; }; @@ -318,8 +318,8 @@ B5DB7D241C4A4BEC007B84D2 /* Frameworks */, 942C1FAD68407A74DB056C2B /* Pods */, B5334F141B8CC5BD00C64A6D /* Products */, - B5334F151B8CC5BD00C64A6D /* QuickTableViewController */, - B5334F221B8CC5BD00C64A6D /* QuickTableViewControllerTests */, + B5334F151B8CC5BD00C64A6D /* QuickTableViewController-iOS */, + B5334F221B8CC5BD00C64A6D /* QuickTableViewControllerTests-iOS */, B5DD432C20639F7800AB661D /* CHANGELOG.md */, B5DD432D20639F7800AB661D /* README.md */, ); @@ -340,29 +340,21 @@ name = Products; sourceTree = ""; }; - B5334F151B8CC5BD00C64A6D /* QuickTableViewController */ = { + B5334F151B8CC5BD00C64A6D /* QuickTableViewController-iOS */ = { isa = PBXGroup; children = ( B55475721F2DC29B0027F7C1 /* Model */, B50E73811F2E1B2C00481910 /* Protocol */, B50E73801F2E193400481910 /* Row */, - B5334F161B8CC5BD00C64A6D /* Supporting Files */, B55475731F2DC2BC0027F7C1 /* View */, - B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */, - ); - path = QuickTableViewController; - sourceTree = ""; - }; - B5334F161B8CC5BD00C64A6D /* Supporting Files */ = { - isa = PBXGroup; - children = ( B5334F171B8CC5BD00C64A6D /* Info.plist */, B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */, + B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */, ); - name = "Supporting Files"; + path = "QuickTableViewController-iOS"; sourceTree = ""; }; - B5334F221B8CC5BD00C64A6D /* QuickTableViewControllerTests */ = { + B5334F221B8CC5BD00C64A6D /* QuickTableViewControllerTests-iOS */ = { isa = PBXGroup; children = ( B51A0E3320692E7100F42693 /* Assets */, @@ -373,7 +365,7 @@ B526776F1FF7EA5A00DC1362 /* CustomTypes.swift */, B5334F241B8CC5BD00C64A6D /* Info.plist */, ); - path = QuickTableViewControllerTests; + path = "QuickTableViewControllerTests-iOS"; sourceTree = ""; }; B55475721F2DC29B0027F7C1 /* Model */ = { @@ -1072,7 +1064,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = QuickTableViewController/Info.plist; + INFOPLIST_FILE = "QuickTableViewController-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController; @@ -1094,7 +1086,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = QuickTableViewController/Info.plist; + INFOPLIST_FILE = "QuickTableViewController-iOS/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController; @@ -1119,9 +1111,9 @@ "DEBUG=1", "$(inherited)", ); - INFOPLIST_FILE = QuickTableViewControllerTests/Info.plist; + INFOPLIST_FILE = "QuickTableViewControllerTests-iOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "me.neuvie.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "io.github.bcylin.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = QuickTableViewControllerTests; SWIFT_VERSION = 3.0; }; @@ -1136,9 +1128,9 @@ "$(PLATFORM_DIR)/Developer/Library/Frameworks", "$(inherited)", ); - INFOPLIST_FILE = QuickTableViewControllerTests/Info.plist; + INFOPLIST_FILE = "QuickTableViewControllerTests-iOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "me.neuvie.$(PRODUCT_NAME:rfc1034identifier)"; + PRODUCT_BUNDLE_IDENTIFIER = "io.github.bcylin.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = QuickTableViewControllerTests; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 3.0; diff --git a/QuickTableViewControllerTests/Assets/icon-highlighted.png b/QuickTableViewControllerTests-iOS/Assets/icon-highlighted.png similarity index 100% rename from QuickTableViewControllerTests/Assets/icon-highlighted.png rename to QuickTableViewControllerTests-iOS/Assets/icon-highlighted.png diff --git a/QuickTableViewControllerTests/Assets/icon.png b/QuickTableViewControllerTests-iOS/Assets/icon.png similarity index 100% rename from QuickTableViewControllerTests/Assets/icon.png rename to QuickTableViewControllerTests-iOS/Assets/icon.png diff --git a/QuickTableViewControllerTests/CustomTypes.swift b/QuickTableViewControllerTests-iOS/CustomTypes.swift similarity index 100% rename from QuickTableViewControllerTests/CustomTypes.swift rename to QuickTableViewControllerTests-iOS/CustomTypes.swift diff --git a/QuickTableViewControllerTests/Info.plist b/QuickTableViewControllerTests-iOS/Info.plist similarity index 100% rename from QuickTableViewControllerTests/Info.plist rename to QuickTableViewControllerTests-iOS/Info.plist diff --git a/QuickTableViewControllerTests/Model/IconSpec.swift b/QuickTableViewControllerTests-iOS/Model/IconSpec.swift similarity index 100% rename from QuickTableViewControllerTests/Model/IconSpec.swift rename to QuickTableViewControllerTests-iOS/Model/IconSpec.swift diff --git a/QuickTableViewControllerTests/Model/RadioSectionSpec.swift b/QuickTableViewControllerTests-iOS/Model/RadioSectionSpec.swift similarity index 100% rename from QuickTableViewControllerTests/Model/RadioSectionSpec.swift rename to QuickTableViewControllerTests-iOS/Model/RadioSectionSpec.swift diff --git a/QuickTableViewControllerTests/Model/SectionSpec.swift b/QuickTableViewControllerTests-iOS/Model/SectionSpec.swift similarity index 100% rename from QuickTableViewControllerTests/Model/SectionSpec.swift rename to QuickTableViewControllerTests-iOS/Model/SectionSpec.swift diff --git a/QuickTableViewControllerTests/Model/SubtitleSpec.swift b/QuickTableViewControllerTests-iOS/Model/SubtitleSpec.swift similarity index 100% rename from QuickTableViewControllerTests/Model/SubtitleSpec.swift rename to QuickTableViewControllerTests-iOS/Model/SubtitleSpec.swift diff --git a/QuickTableViewControllerTests/Row/NavigationRowSpec.swift b/QuickTableViewControllerTests-iOS/Row/NavigationRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests/Row/NavigationRowSpec.swift rename to QuickTableViewControllerTests-iOS/Row/NavigationRowSpec.swift diff --git a/QuickTableViewControllerTests/Row/OptionRowSpec.swift b/QuickTableViewControllerTests-iOS/Row/OptionRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests/Row/OptionRowSpec.swift rename to QuickTableViewControllerTests-iOS/Row/OptionRowSpec.swift diff --git a/QuickTableViewControllerTests/Row/SwitchRowSpec.swift b/QuickTableViewControllerTests-iOS/Row/SwitchRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests/Row/SwitchRowSpec.swift rename to QuickTableViewControllerTests-iOS/Row/SwitchRowSpec.swift diff --git a/QuickTableViewControllerTests/Row/TapActionRowSpec.swift b/QuickTableViewControllerTests-iOS/Row/TapActionRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests/Row/TapActionRowSpec.swift rename to QuickTableViewControllerTests-iOS/Row/TapActionRowSpec.swift diff --git a/QuickTableViewControllerTests/View/ConfigurableSpec.swift b/QuickTableViewControllerTests-iOS/View/ConfigurableSpec.swift similarity index 100% rename from QuickTableViewControllerTests/View/ConfigurableSpec.swift rename to QuickTableViewControllerTests-iOS/View/ConfigurableSpec.swift diff --git a/QuickTableViewControllerTests/View/ReusableSpec.swift b/QuickTableViewControllerTests-iOS/View/ReusableSpec.swift similarity index 100% rename from QuickTableViewControllerTests/View/ReusableSpec.swift rename to QuickTableViewControllerTests-iOS/View/ReusableSpec.swift diff --git a/QuickTableViewControllerTests/ViewController/QuickTableViewControllerSpec.swift b/QuickTableViewControllerTests-iOS/ViewController/QuickTableViewControllerSpec.swift similarity index 100% rename from QuickTableViewControllerTests/ViewController/QuickTableViewControllerSpec.swift rename to QuickTableViewControllerTests-iOS/ViewController/QuickTableViewControllerSpec.swift diff --git a/QuickTableViewControllerTests/ViewController/QuickTableViewDataSourceSpec.swift b/QuickTableViewControllerTests-iOS/ViewController/QuickTableViewDataSourceSpec.swift similarity index 100% rename from QuickTableViewControllerTests/ViewController/QuickTableViewDataSourceSpec.swift rename to QuickTableViewControllerTests-iOS/ViewController/QuickTableViewDataSourceSpec.swift diff --git a/QuickTableViewControllerTests/ViewController/QuickTableViewDelegateSpec.swift b/QuickTableViewControllerTests-iOS/ViewController/QuickTableViewDelegateSpec.swift similarity index 100% rename from QuickTableViewControllerTests/ViewController/QuickTableViewDelegateSpec.swift rename to QuickTableViewControllerTests-iOS/ViewController/QuickTableViewDelegateSpec.swift From 942ec5c31be9be043abc274f5f87da6acb79ccde Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 26 Mar 2018 22:03:17 +0800 Subject: [PATCH 10/23] Separate source files from the iOS target folder --- .../project.pbxproj | 66 +++++++++++-------- Source/{Model => Rows}/NavigationRow.swift | 0 Source/{Model => Rows}/OptionRow.swift | 0 Source/{Model => Rows}/SwitchRow.swift | 0 Source/{Model => Rows}/TapActionRow.swift | 0 Source/{View => Views}/SwitchCell.swift | 0 Source/{View => Views}/TapActionCell.swift | 0 7 files changed, 39 insertions(+), 27 deletions(-) rename Source/{Model => Rows}/NavigationRow.swift (100%) rename Source/{Model => Rows}/OptionRow.swift (100%) rename Source/{Model => Rows}/SwitchRow.swift (100%) rename Source/{Model => Rows}/TapActionRow.swift (100%) rename Source/{View => Views}/SwitchCell.swift (100%) rename Source/{View => Views}/TapActionCell.swift (100%) diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 836e1e3d..06d306e9 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -133,7 +133,7 @@ B578B5081C5673240021F7C3 /* icon-highlighted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-highlighted.png"; sourceTree = ""; }; B57FAA6C1C512D5B008FF7C7 /* QuickTableViewControllerSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuickTableViewControllerSpec.swift; sourceTree = ""; }; B5824E8A1FF3B639009666C8 /* ConfigurableSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigurableSpec.swift; sourceTree = ""; }; - B595627A1B9758BC00D6DAB1 /* TapActionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TapActionCell.swift; path = Source/View/TapActionCell.swift; sourceTree = SOURCE_ROOT; }; + B595627A1B9758BC00D6DAB1 /* TapActionCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TapActionCell.swift; path = Source/Views/TapActionCell.swift; sourceTree = SOURCE_ROOT; }; B5A37EAD20208EF7009C075F /* AppearanceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearanceViewController.swift; sourceTree = ""; }; B5A37EAF20208F4E009C075F /* UITableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = UITableViewCell.xib; sourceTree = ""; }; B5A37EB1202091C4009C075F /* SwitchCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SwitchCell.xib; sourceTree = ""; }; @@ -154,14 +154,14 @@ B5E029201DC7A39200B5C90E /* Section.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Section.swift; path = Source/Model/Section.swift; sourceTree = SOURCE_ROOT; }; B5E029221DC8B3EC00B5C90E /* Icon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Icon.swift; path = Source/Model/Icon.swift; sourceTree = SOURCE_ROOT; }; B5E619CE1F454CF0005200E1 /* RadioSection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RadioSection.swift; path = Source/Model/RadioSection.swift; sourceTree = SOURCE_ROOT; }; - B5E619D11F454EEF005200E1 /* OptionRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OptionRow.swift; path = Source/Model/OptionRow.swift; sourceTree = SOURCE_ROOT; }; + B5E619D11F454EEF005200E1 /* OptionRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OptionRow.swift; path = Source/Rows/OptionRow.swift; sourceTree = SOURCE_ROOT; }; B5E619D31F45708F005200E1 /* OptionRowSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OptionRowSpec.swift; sourceTree = ""; }; B5E619D61F4589F7005200E1 /* RadioSectionSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RadioSectionSpec.swift; sourceTree = ""; }; B5EC18221B95FD7F0015C665 /* Row.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Row.swift; path = Source/Protocol/Row.swift; sourceTree = SOURCE_ROOT; }; - B5F0FFE51E9CC69C007BF1C9 /* SwitchCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwitchCell.swift; path = Source/View/SwitchCell.swift; sourceTree = SOURCE_ROOT; }; - B5F0FFE71E9CC6E8007BF1C9 /* NavigationRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NavigationRow.swift; path = Source/Model/NavigationRow.swift; sourceTree = SOURCE_ROOT; }; - B5F0FFE91E9CC6F9007BF1C9 /* SwitchRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwitchRow.swift; path = Source/Model/SwitchRow.swift; sourceTree = SOURCE_ROOT; }; - B5F0FFEB1E9CC72D007BF1C9 /* TapActionRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TapActionRow.swift; path = Source/Model/TapActionRow.swift; sourceTree = SOURCE_ROOT; }; + B5F0FFE51E9CC69C007BF1C9 /* SwitchCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwitchCell.swift; path = Source/Views/SwitchCell.swift; sourceTree = SOURCE_ROOT; }; + B5F0FFE71E9CC6E8007BF1C9 /* NavigationRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NavigationRow.swift; path = Source/Rows/NavigationRow.swift; sourceTree = SOURCE_ROOT; }; + B5F0FFE91E9CC6F9007BF1C9 /* SwitchRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwitchRow.swift; path = Source/Rows/SwitchRow.swift; sourceTree = SOURCE_ROOT; }; + B5F0FFEB1E9CC72D007BF1C9 /* TapActionRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TapActionRow.swift; path = Source/Rows/TapActionRow.swift; sourceTree = SOURCE_ROOT; }; B5F0FFED1E9CC73D007BF1C9 /* Subtitle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Subtitle.swift; path = Source/Model/Subtitle.swift; sourceTree = SOURCE_ROOT; }; F45E7695B97DC7347A2C89EF /* Pods-QuickTableViewControllerTests-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickTableViewControllerTests-iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-QuickTableViewControllerTests-iOS/Pods-QuickTableViewControllerTests-iOS.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -212,17 +212,6 @@ name = Pods; sourceTree = ""; }; - B50E73801F2E193400481910 /* Row */ = { - isa = PBXGroup; - children = ( - B5F0FFE71E9CC6E8007BF1C9 /* NavigationRow.swift */, - B5E619D11F454EEF005200E1 /* OptionRow.swift */, - B5F0FFE91E9CC6F9007BF1C9 /* SwitchRow.swift */, - B5F0FFEB1E9CC72D007BF1C9 /* TapActionRow.swift */, - ); - name = Row; - sourceTree = ""; - }; B50E73811F2E1B2C00481910 /* Protocol */ = { isa = PBXGroup; children = ( @@ -236,7 +225,8 @@ B5374C921FDD7B3E00A3EA28 /* TapActionRowCompatible.swift */, ); name = Protocol; - sourceTree = ""; + path = "QuickTableViewController-iOS"; + sourceTree = SOURCE_ROOT; }; B51A0E2D20692AFD00F42693 /* View */ = { isa = PBXGroup; @@ -288,6 +278,30 @@ path = Assets; sourceTree = ""; }; + B51A0E7A206934C300F42693 /* Source */ = { + isa = PBXGroup; + children = ( + B55475721F2DC29B0027F7C1 /* Model */, + B50E73811F2E1B2C00481910 /* Protocol */, + B51A0EE1206F62AD00F42693 /* Rows */, + B55475731F2DC2BC0027F7C1 /* Views */, + B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */, + ); + path = Source; + sourceTree = ""; + }; + B51A0EE1206F62AD00F42693 /* Rows */ = { + isa = PBXGroup; + children = ( + B5F0FFE71E9CC6E8007BF1C9 /* NavigationRow.swift */, + B5E619D11F454EEF005200E1 /* OptionRow.swift */, + B5F0FFE91E9CC6F9007BF1C9 /* SwitchRow.swift */, + B5F0FFEB1E9CC72D007BF1C9 /* TapActionRow.swift */, + ); + name = Rows; + path = Source/Rows; + sourceTree = SOURCE_ROOT; + }; B51F21A31F417037009BC2C9 /* Example */ = { isa = PBXGroup; children = ( @@ -320,6 +334,7 @@ B5334F141B8CC5BD00C64A6D /* Products */, B5334F151B8CC5BD00C64A6D /* QuickTableViewController-iOS */, B5334F221B8CC5BD00C64A6D /* QuickTableViewControllerTests-iOS */, + B51A0E7A206934C300F42693 /* Source */, B5DD432C20639F7800AB661D /* CHANGELOG.md */, B5DD432D20639F7800AB661D /* README.md */, ); @@ -343,13 +358,8 @@ B5334F151B8CC5BD00C64A6D /* QuickTableViewController-iOS */ = { isa = PBXGroup; children = ( - B55475721F2DC29B0027F7C1 /* Model */, - B50E73811F2E1B2C00481910 /* Protocol */, - B50E73801F2E193400481910 /* Row */, - B55475731F2DC2BC0027F7C1 /* View */, B5334F171B8CC5BD00C64A6D /* Info.plist */, B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */, - B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */, ); path = "QuickTableViewController-iOS"; sourceTree = ""; @@ -377,16 +387,18 @@ B5F0FFED1E9CC73D007BF1C9 /* Subtitle.swift */, ); name = Model; - sourceTree = ""; + path = "QuickTableViewController-iOS"; + sourceTree = SOURCE_ROOT; }; - B55475731F2DC2BC0027F7C1 /* View */ = { + B55475731F2DC2BC0027F7C1 /* Views */ = { isa = PBXGroup; children = ( B5F0FFE51E9CC69C007BF1C9 /* SwitchCell.swift */, B595627A1B9758BC00D6DAB1 /* TapActionCell.swift */, ); - name = View; - sourceTree = ""; + name = Views; + path = Source/Views; + sourceTree = SOURCE_ROOT; }; B5A37EB7202093A3009C075F /* UINibs */ = { isa = PBXGroup; diff --git a/Source/Model/NavigationRow.swift b/Source/Rows/NavigationRow.swift similarity index 100% rename from Source/Model/NavigationRow.swift rename to Source/Rows/NavigationRow.swift diff --git a/Source/Model/OptionRow.swift b/Source/Rows/OptionRow.swift similarity index 100% rename from Source/Model/OptionRow.swift rename to Source/Rows/OptionRow.swift diff --git a/Source/Model/SwitchRow.swift b/Source/Rows/SwitchRow.swift similarity index 100% rename from Source/Model/SwitchRow.swift rename to Source/Rows/SwitchRow.swift diff --git a/Source/Model/TapActionRow.swift b/Source/Rows/TapActionRow.swift similarity index 100% rename from Source/Model/TapActionRow.swift rename to Source/Rows/TapActionRow.swift diff --git a/Source/View/SwitchCell.swift b/Source/Views/SwitchCell.swift similarity index 100% rename from Source/View/SwitchCell.swift rename to Source/Views/SwitchCell.swift diff --git a/Source/View/TapActionCell.swift b/Source/Views/TapActionCell.swift similarity index 100% rename from Source/View/TapActionCell.swift rename to Source/Views/TapActionCell.swift From 518139aa2c946f9caee5ca4aa551940026bd751e Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 31 Mar 2018 14:41:23 +0800 Subject: [PATCH 11/23] Add the platform as the suffix to the targets --- .codecov.yml | 9 +- .travis.yml | 2 +- {Example => Example-iOS}/AppDelegate.swift | 0 .../AppIcon.appiconset/Contents.json | 0 .../Assets.xcassets/Contents.json | 0 .../iconmonstr-gear.imageset/Contents.json | 0 .../iconmonstr-gear.png | Bin .../iconmonstr-gear@2x.png | Bin .../iconmonstr-gear@3x.png | Bin .../iconmonstr-globe.imageset/Contents.json | 0 .../iconmonstr-globe.png | Bin .../iconmonstr-globe@2x.png | Bin .../iconmonstr-globe@3x.png | Bin .../iconmonstr-time.imageset/Contents.json | 0 .../iconmonstr-time.png | Bin .../iconmonstr-time@2x.png | Bin .../iconmonstr-time@3x.png | Bin .../iconmonstr-x-mark.imageset/Contents.json | 0 .../iconmonstr-x-mark.png | Bin .../iconmonstr-x-mark@2x.png | Bin .../iconmonstr-x-mark@3x.png | Bin .../Base.lproj/LaunchScreen.xib | 0 {Example => Example-iOS}/Info.plist | 0 .../UINibs/OptionCell.xib | 0 .../UINibs/SwitchCell.xib | 0 .../UINibs/TapActionCell.xib | 0 .../UINibs/UITableViewCell.xib | 0 .../AppearanceViewController.swift | 0 .../CustomizationViewController.swift | 0 .../DefaultViewController.swift | 0 .../ViewControllers/RootViewController.swift | 0 .../ExampleUITests.swift | 0 .../Info.plist | 0 Makefile | 2 +- Podfile | 4 +- Podfile.lock | 2 +- .../Assets/icon-highlighted.png | Bin .../Assets/icon.png | Bin .../CustomTypes.swift | 0 .../Info.plist | 0 .../Model/IconSpec.swift | 0 .../Model/RadioSectionSpec.swift | 0 .../Model/SectionSpec.swift | 0 .../Model/SubtitleSpec.swift | 0 .../Row/NavigationRowSpec.swift | 0 .../Row/OptionRowSpec.swift | 0 .../Row/SwitchRowSpec.swift | 0 .../Row/TapActionRowSpec.swift | 0 .../View/ConfigurableSpec.swift | 0 .../View/ReusableSpec.swift | 0 .../QuickTableViewControllerSpec.swift | 0 .../QuickTableViewDataSourceSpec.swift | 0 .../QuickTableViewDelegateSpec.swift | 0 .../project.pbxproj | 162 +++++++++--------- ...{Example.xcscheme => Example-iOS.xcscheme} | 20 +-- .../QuickTableViewController-iOS.xcscheme | 4 +- 56 files changed, 103 insertions(+), 102 deletions(-) rename {Example => Example-iOS}/AppDelegate.swift (100%) rename {Example => Example-iOS}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {Example => Example-iOS}/Assets.xcassets/Contents.json (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-gear.imageset/Contents.json (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear@2x.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear@3x.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-globe.imageset/Contents.json (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe@2x.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe@3x.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-time.imageset/Contents.json (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time@2x.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time@3x.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-x-mark.imageset/Contents.json (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark@2x.png (100%) rename {Example => Example-iOS}/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark@3x.png (100%) rename {Example => Example-iOS}/Base.lproj/LaunchScreen.xib (100%) rename {Example => Example-iOS}/Info.plist (100%) rename {Example => Example-iOS}/UINibs/OptionCell.xib (100%) rename {Example => Example-iOS}/UINibs/SwitchCell.xib (100%) rename {Example => Example-iOS}/UINibs/TapActionCell.xib (100%) rename {Example => Example-iOS}/UINibs/UITableViewCell.xib (100%) rename {Example => Example-iOS}/ViewControllers/AppearanceViewController.swift (100%) rename {Example => Example-iOS}/ViewControllers/CustomizationViewController.swift (100%) rename {Example => Example-iOS}/ViewControllers/DefaultViewController.swift (100%) rename {Example => Example-iOS}/ViewControllers/RootViewController.swift (100%) rename {ExampleUITests => Example-iOSUITests}/ExampleUITests.swift (100%) rename {ExampleUITests => Example-iOSUITests}/Info.plist (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Assets/icon-highlighted.png (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Assets/icon.png (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/CustomTypes.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Info.plist (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Model/IconSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Model/RadioSectionSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Model/SectionSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Model/SubtitleSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Row/NavigationRowSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Row/OptionRowSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Row/SwitchRowSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/Row/TapActionRowSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/View/ConfigurableSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/View/ReusableSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/ViewController/QuickTableViewControllerSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/ViewController/QuickTableViewDataSourceSpec.swift (100%) rename {QuickTableViewControllerTests-iOS => QuickTableViewController-iOSTests}/ViewController/QuickTableViewDelegateSpec.swift (100%) rename QuickTableViewController.xcodeproj/xcshareddata/xcschemes/{Example.xcscheme => Example-iOS.xcscheme} (87%) diff --git a/.codecov.yml b/.codecov.yml index 1d318d85..8874afe9 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,7 +1,6 @@ coverage: ignore: - - Carthage/.* - - Example/.* - - ExampleUITests/.* - - QuickTableViewControllerTests/.* - - Pods/.* + - "Carthage/**/*" + - "Example*/**/*" + - "*Tests/**/*" + - "Pods/**/*" diff --git a/.travis.yml b/.travis.yml index 17f968cb..7cd637dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_script: script: - bundle exec rake ci:test[QuickTableViewController-iOS] - bash <(curl -s https://codecov.io/bash) -cF ios -J "QuickTableViewController" - - bundle exec rake ci:test[Example] + - bundle exec rake ci:test[Example-iOS] - make -B carthage - make -B docs after_success: diff --git a/Example/AppDelegate.swift b/Example-iOS/AppDelegate.swift similarity index 100% rename from Example/AppDelegate.swift rename to Example-iOS/AppDelegate.swift diff --git a/Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example-iOS/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Example/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Example-iOS/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Example/Assets.xcassets/Contents.json b/Example-iOS/Assets.xcassets/Contents.json similarity index 100% rename from Example/Assets.xcassets/Contents.json rename to Example-iOS/Assets.xcassets/Contents.json diff --git a/Example/Assets.xcassets/iconmonstr-gear.imageset/Contents.json b/Example-iOS/Assets.xcassets/iconmonstr-gear.imageset/Contents.json similarity index 100% rename from Example/Assets.xcassets/iconmonstr-gear.imageset/Contents.json rename to Example-iOS/Assets.xcassets/iconmonstr-gear.imageset/Contents.json diff --git a/Example/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear.png b/Example-iOS/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear.png rename to Example-iOS/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear.png diff --git a/Example/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear@2x.png b/Example-iOS/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear@2x.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear@2x.png rename to Example-iOS/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear@2x.png diff --git a/Example/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear@3x.png b/Example-iOS/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear@3x.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear@3x.png rename to Example-iOS/Assets.xcassets/iconmonstr-gear.imageset/iconmonstr-gear@3x.png diff --git a/Example/Assets.xcassets/iconmonstr-globe.imageset/Contents.json b/Example-iOS/Assets.xcassets/iconmonstr-globe.imageset/Contents.json similarity index 100% rename from Example/Assets.xcassets/iconmonstr-globe.imageset/Contents.json rename to Example-iOS/Assets.xcassets/iconmonstr-globe.imageset/Contents.json diff --git a/Example/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe.png b/Example-iOS/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe.png rename to Example-iOS/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe.png diff --git a/Example/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe@2x.png b/Example-iOS/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe@2x.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe@2x.png rename to Example-iOS/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe@2x.png diff --git a/Example/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe@3x.png b/Example-iOS/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe@3x.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe@3x.png rename to Example-iOS/Assets.xcassets/iconmonstr-globe.imageset/iconmonstr-globe@3x.png diff --git a/Example/Assets.xcassets/iconmonstr-time.imageset/Contents.json b/Example-iOS/Assets.xcassets/iconmonstr-time.imageset/Contents.json similarity index 100% rename from Example/Assets.xcassets/iconmonstr-time.imageset/Contents.json rename to Example-iOS/Assets.xcassets/iconmonstr-time.imageset/Contents.json diff --git a/Example/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time.png b/Example-iOS/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time.png rename to Example-iOS/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time.png diff --git a/Example/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time@2x.png b/Example-iOS/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time@2x.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time@2x.png rename to Example-iOS/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time@2x.png diff --git a/Example/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time@3x.png b/Example-iOS/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time@3x.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time@3x.png rename to Example-iOS/Assets.xcassets/iconmonstr-time.imageset/iconmonstr-time@3x.png diff --git a/Example/Assets.xcassets/iconmonstr-x-mark.imageset/Contents.json b/Example-iOS/Assets.xcassets/iconmonstr-x-mark.imageset/Contents.json similarity index 100% rename from Example/Assets.xcassets/iconmonstr-x-mark.imageset/Contents.json rename to Example-iOS/Assets.xcassets/iconmonstr-x-mark.imageset/Contents.json diff --git a/Example/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark.png b/Example-iOS/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark.png rename to Example-iOS/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark.png diff --git a/Example/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark@2x.png b/Example-iOS/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark@2x.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark@2x.png rename to Example-iOS/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark@2x.png diff --git a/Example/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark@3x.png b/Example-iOS/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark@3x.png similarity index 100% rename from Example/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark@3x.png rename to Example-iOS/Assets.xcassets/iconmonstr-x-mark.imageset/iconmonstr-x-mark@3x.png diff --git a/Example/Base.lproj/LaunchScreen.xib b/Example-iOS/Base.lproj/LaunchScreen.xib similarity index 100% rename from Example/Base.lproj/LaunchScreen.xib rename to Example-iOS/Base.lproj/LaunchScreen.xib diff --git a/Example/Info.plist b/Example-iOS/Info.plist similarity index 100% rename from Example/Info.plist rename to Example-iOS/Info.plist diff --git a/Example/UINibs/OptionCell.xib b/Example-iOS/UINibs/OptionCell.xib similarity index 100% rename from Example/UINibs/OptionCell.xib rename to Example-iOS/UINibs/OptionCell.xib diff --git a/Example/UINibs/SwitchCell.xib b/Example-iOS/UINibs/SwitchCell.xib similarity index 100% rename from Example/UINibs/SwitchCell.xib rename to Example-iOS/UINibs/SwitchCell.xib diff --git a/Example/UINibs/TapActionCell.xib b/Example-iOS/UINibs/TapActionCell.xib similarity index 100% rename from Example/UINibs/TapActionCell.xib rename to Example-iOS/UINibs/TapActionCell.xib diff --git a/Example/UINibs/UITableViewCell.xib b/Example-iOS/UINibs/UITableViewCell.xib similarity index 100% rename from Example/UINibs/UITableViewCell.xib rename to Example-iOS/UINibs/UITableViewCell.xib diff --git a/Example/ViewControllers/AppearanceViewController.swift b/Example-iOS/ViewControllers/AppearanceViewController.swift similarity index 100% rename from Example/ViewControllers/AppearanceViewController.swift rename to Example-iOS/ViewControllers/AppearanceViewController.swift diff --git a/Example/ViewControllers/CustomizationViewController.swift b/Example-iOS/ViewControllers/CustomizationViewController.swift similarity index 100% rename from Example/ViewControllers/CustomizationViewController.swift rename to Example-iOS/ViewControllers/CustomizationViewController.swift diff --git a/Example/ViewControllers/DefaultViewController.swift b/Example-iOS/ViewControllers/DefaultViewController.swift similarity index 100% rename from Example/ViewControllers/DefaultViewController.swift rename to Example-iOS/ViewControllers/DefaultViewController.swift diff --git a/Example/ViewControllers/RootViewController.swift b/Example-iOS/ViewControllers/RootViewController.swift similarity index 100% rename from Example/ViewControllers/RootViewController.swift rename to Example-iOS/ViewControllers/RootViewController.swift diff --git a/ExampleUITests/ExampleUITests.swift b/Example-iOSUITests/ExampleUITests.swift similarity index 100% rename from ExampleUITests/ExampleUITests.swift rename to Example-iOSUITests/ExampleUITests.swift diff --git a/ExampleUITests/Info.plist b/Example-iOSUITests/Info.plist similarity index 100% rename from ExampleUITests/Info.plist rename to Example-iOSUITests/Info.plist diff --git a/Makefile b/Makefile index 03cdbc06..6bc78c9c 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ default: test test: bundle exec rake 'ci:test[QuickTableViewController-iOS]' - bundle exec rake 'ci:test[Example]' + bundle exec rake 'ci:test[Example-iOS]' ci-test: test make -B carthage diff --git a/Podfile b/Podfile index 6fbd399b..43ad5cc1 100644 --- a/Podfile +++ b/Podfile @@ -4,12 +4,12 @@ use_frameworks! workspace "QuickTableViewController" project "QuickTableViewController" -target "QuickTableViewControllerTests-iOS" do +target "QuickTableViewController-iOSTests" do pod "Nimble", git: "https://github.com/Quick/Nimble.git", tag: "v7.0.2" pod "Quick", git: "https://github.com/Quick/Quick.git", tag: "v1.2.0" end -target "Example" do +target "Example-iOS" do pod "SwiftLint", "0.23.1" pod "Weakify", git: "https://github.com/klundberg/Weakify.git", tag: "v0.4.0" end diff --git a/Podfile.lock b/Podfile.lock index b3f26548..480342b5 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -38,6 +38,6 @@ SPEC CHECKSUMS: SwiftLint: 1b670ce79284c76520f84060e87d645078fd32fa Weakify: 77be86c462237baa373e97fcf57d4d8637c2e614 -PODFILE CHECKSUM: a3841a8adaee9cf3a3e7ab3c47a296a846c65d87 +PODFILE CHECKSUM: 460e2597e90a61f53f0a95f1905dbfe2a8d3855a COCOAPODS: 1.4.0 diff --git a/QuickTableViewControllerTests-iOS/Assets/icon-highlighted.png b/QuickTableViewController-iOSTests/Assets/icon-highlighted.png similarity index 100% rename from QuickTableViewControllerTests-iOS/Assets/icon-highlighted.png rename to QuickTableViewController-iOSTests/Assets/icon-highlighted.png diff --git a/QuickTableViewControllerTests-iOS/Assets/icon.png b/QuickTableViewController-iOSTests/Assets/icon.png similarity index 100% rename from QuickTableViewControllerTests-iOS/Assets/icon.png rename to QuickTableViewController-iOSTests/Assets/icon.png diff --git a/QuickTableViewControllerTests-iOS/CustomTypes.swift b/QuickTableViewController-iOSTests/CustomTypes.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/CustomTypes.swift rename to QuickTableViewController-iOSTests/CustomTypes.swift diff --git a/QuickTableViewControllerTests-iOS/Info.plist b/QuickTableViewController-iOSTests/Info.plist similarity index 100% rename from QuickTableViewControllerTests-iOS/Info.plist rename to QuickTableViewController-iOSTests/Info.plist diff --git a/QuickTableViewControllerTests-iOS/Model/IconSpec.swift b/QuickTableViewController-iOSTests/Model/IconSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/Model/IconSpec.swift rename to QuickTableViewController-iOSTests/Model/IconSpec.swift diff --git a/QuickTableViewControllerTests-iOS/Model/RadioSectionSpec.swift b/QuickTableViewController-iOSTests/Model/RadioSectionSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/Model/RadioSectionSpec.swift rename to QuickTableViewController-iOSTests/Model/RadioSectionSpec.swift diff --git a/QuickTableViewControllerTests-iOS/Model/SectionSpec.swift b/QuickTableViewController-iOSTests/Model/SectionSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/Model/SectionSpec.swift rename to QuickTableViewController-iOSTests/Model/SectionSpec.swift diff --git a/QuickTableViewControllerTests-iOS/Model/SubtitleSpec.swift b/QuickTableViewController-iOSTests/Model/SubtitleSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/Model/SubtitleSpec.swift rename to QuickTableViewController-iOSTests/Model/SubtitleSpec.swift diff --git a/QuickTableViewControllerTests-iOS/Row/NavigationRowSpec.swift b/QuickTableViewController-iOSTests/Row/NavigationRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/Row/NavigationRowSpec.swift rename to QuickTableViewController-iOSTests/Row/NavigationRowSpec.swift diff --git a/QuickTableViewControllerTests-iOS/Row/OptionRowSpec.swift b/QuickTableViewController-iOSTests/Row/OptionRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/Row/OptionRowSpec.swift rename to QuickTableViewController-iOSTests/Row/OptionRowSpec.swift diff --git a/QuickTableViewControllerTests-iOS/Row/SwitchRowSpec.swift b/QuickTableViewController-iOSTests/Row/SwitchRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/Row/SwitchRowSpec.swift rename to QuickTableViewController-iOSTests/Row/SwitchRowSpec.swift diff --git a/QuickTableViewControllerTests-iOS/Row/TapActionRowSpec.swift b/QuickTableViewController-iOSTests/Row/TapActionRowSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/Row/TapActionRowSpec.swift rename to QuickTableViewController-iOSTests/Row/TapActionRowSpec.swift diff --git a/QuickTableViewControllerTests-iOS/View/ConfigurableSpec.swift b/QuickTableViewController-iOSTests/View/ConfigurableSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/View/ConfigurableSpec.swift rename to QuickTableViewController-iOSTests/View/ConfigurableSpec.swift diff --git a/QuickTableViewControllerTests-iOS/View/ReusableSpec.swift b/QuickTableViewController-iOSTests/View/ReusableSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/View/ReusableSpec.swift rename to QuickTableViewController-iOSTests/View/ReusableSpec.swift diff --git a/QuickTableViewControllerTests-iOS/ViewController/QuickTableViewControllerSpec.swift b/QuickTableViewController-iOSTests/ViewController/QuickTableViewControllerSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/ViewController/QuickTableViewControllerSpec.swift rename to QuickTableViewController-iOSTests/ViewController/QuickTableViewControllerSpec.swift diff --git a/QuickTableViewControllerTests-iOS/ViewController/QuickTableViewDataSourceSpec.swift b/QuickTableViewController-iOSTests/ViewController/QuickTableViewDataSourceSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/ViewController/QuickTableViewDataSourceSpec.swift rename to QuickTableViewController-iOSTests/ViewController/QuickTableViewDataSourceSpec.swift diff --git a/QuickTableViewControllerTests-iOS/ViewController/QuickTableViewDelegateSpec.swift b/QuickTableViewController-iOSTests/ViewController/QuickTableViewDelegateSpec.swift similarity index 100% rename from QuickTableViewControllerTests-iOS/ViewController/QuickTableViewDelegateSpec.swift rename to QuickTableViewController-iOSTests/ViewController/QuickTableViewDelegateSpec.swift diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 06d306e9..9d6f2d96 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -7,8 +7,8 @@ objects = { /* Begin PBXBuildFile section */ - 6FEC7AFD957FDD634E547C82 /* Pods_QuickTableViewControllerTests_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25C329622749AE5FEB731F1A /* Pods_QuickTableViewControllerTests_iOS.framework */; }; - B25D5B851E9D987AFEB96BB4 /* Pods_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0CA13E27E7B47A3F6F9FFE5B /* Pods_Example.framework */; }; + 1DF796C7F4630ACDCE1DE189 /* Pods_QuickTableViewController_iOSTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51571B6D4B25D0BCCCFFBCF5 /* Pods_QuickTableViewController_iOSTests.framework */; }; + A7A26A71AB271F9D402D1A12 /* Pods_Example_iOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF3454E57819285B32968564 /* Pods_Example_iOS.framework */; }; B50E73851F2E1BC900481910 /* RowStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50E73841F2E1BC900481910 /* RowStyle.swift */; }; B51F21A51F417037009BC2C9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F21A41F417037009BC2C9 /* AppDelegate.swift */; }; B51F21A71F417037009BC2C9 /* DefaultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F21A61F417037009BC2C9 /* DefaultViewController.swift */; }; @@ -62,19 +62,19 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - B51F21B91F41712E009BC2C9 /* PBXContainerItemProxy */ = { + B51A0E912069360500F42693 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = B5334F0A1B8CC5BD00C64A6D /* Project object */; proxyType = 1; - remoteGlobalIDString = B5334F121B8CC5BD00C64A6D; - remoteInfo = "QuickTableViewController-iOS"; + remoteGlobalIDString = B51F21A11F417037009BC2C9; + remoteInfo = "Example-iOS"; }; - B51F21C51F41E600009BC2C9 /* PBXContainerItemProxy */ = { + B51F21B91F41712E009BC2C9 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = B5334F0A1B8CC5BD00C64A6D /* Project object */; proxyType = 1; - remoteGlobalIDString = B51F21A11F417037009BC2C9; - remoteInfo = Example; + remoteGlobalIDString = B5334F121B8CC5BD00C64A6D; + remoteInfo = "QuickTableViewController-iOS"; }; B5334F201B8CC5BD00C64A6D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -100,18 +100,18 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0CA13E27E7B47A3F6F9FFE5B /* Pods_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 25C329622749AE5FEB731F1A /* Pods_QuickTableViewControllerTests_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_QuickTableViewControllerTests_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 332BB2E7F8C766C8BC0D5B5B /* Pods-QuickTableViewControllerTests-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickTableViewControllerTests-iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-QuickTableViewControllerTests-iOS/Pods-QuickTableViewControllerTests-iOS.debug.xcconfig"; sourceTree = ""; }; - 965EA9FBCB752A21189A0BC0 /* Pods-Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.debug.xcconfig"; sourceTree = ""; }; + 466DB8C8ACDE64B9E0EF8D74 /* Pods-QuickTableViewController-iOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickTableViewController-iOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-QuickTableViewController-iOSTests/Pods-QuickTableViewController-iOSTests.release.xcconfig"; sourceTree = ""; }; + 4EE4E01857269725E8A86D1C /* Pods-QuickTableViewController-iOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickTableViewController-iOSTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-QuickTableViewController-iOSTests/Pods-QuickTableViewController-iOSTests.debug.xcconfig"; sourceTree = ""; }; + 51571B6D4B25D0BCCCFFBCF5 /* Pods_QuickTableViewController_iOSTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_QuickTableViewController_iOSTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A57FEA19A020A7DE44AE8BCE /* Pods-Example-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-iOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Example-iOS/Pods-Example-iOS.debug.xcconfig"; sourceTree = ""; }; B50E73841F2E1BC900481910 /* RowStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RowStyle.swift; path = Source/Protocol/RowStyle.swift; sourceTree = SOURCE_ROOT; }; - B51F21A21F417037009BC2C9 /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + B51F21A21F417037009BC2C9 /* Example-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; B51F21A41F417037009BC2C9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; B51F21A61F417037009BC2C9 /* DefaultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultViewController.swift; sourceTree = ""; }; B51F21AB1F417037009BC2C9 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; B51F21B01F417037009BC2C9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B51F21B51F41709B009BC2C9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - B51F21C01F41E600009BC2C9 /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + B51F21C01F41E600009BC2C9 /* Example-iOSUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Example-iOSUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; B51F21C21F41E600009BC2C9 /* ExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleUITests.swift; sourceTree = ""; }; B51F21C41F41E600009BC2C9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B522E1DF1F4AA750004DA5AD /* Reusable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Reusable.swift; path = Source/Protocol/Reusable.swift; sourceTree = SOURCE_ROOT; }; @@ -141,7 +141,6 @@ B5A37EB52020937A009C075F /* OptionCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OptionCell.xib; sourceTree = ""; }; B5A67A1120205F5C0075E0C8 /* CustomizationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomizationViewController.swift; sourceTree = ""; }; B5A67A13202069440075E0C8 /* RootViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootViewController.swift; sourceTree = ""; }; - B5C29201F434E855A1E9A3E9 /* Pods-Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example/Pods-Example.release.xcconfig"; sourceTree = ""; }; B5DB7D251C4B7F0E007B84D2 /* IconSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IconSpec.swift; sourceTree = ""; }; B5DB7D2C1C4B8294007B84D2 /* NavigationRowSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationRowSpec.swift; sourceTree = ""; }; B5DB7D2E1C4B95D3007B84D2 /* SwitchRowSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwitchRowSpec.swift; sourceTree = ""; }; @@ -163,7 +162,8 @@ B5F0FFE91E9CC6F9007BF1C9 /* SwitchRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwitchRow.swift; path = Source/Rows/SwitchRow.swift; sourceTree = SOURCE_ROOT; }; B5F0FFEB1E9CC72D007BF1C9 /* TapActionRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TapActionRow.swift; path = Source/Rows/TapActionRow.swift; sourceTree = SOURCE_ROOT; }; B5F0FFED1E9CC73D007BF1C9 /* Subtitle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Subtitle.swift; path = Source/Model/Subtitle.swift; sourceTree = SOURCE_ROOT; }; - F45E7695B97DC7347A2C89EF /* Pods-QuickTableViewControllerTests-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-QuickTableViewControllerTests-iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-QuickTableViewControllerTests-iOS/Pods-QuickTableViewControllerTests-iOS.release.xcconfig"; sourceTree = ""; }; + BF3454E57819285B32968564 /* Pods_Example_iOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Example_iOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + DE3777B435AF4EF82051BCFD /* Pods-Example-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Example-iOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-Example-iOS/Pods-Example-iOS.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -171,7 +171,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - B25D5B851E9D987AFEB96BB4 /* Pods_Example.framework in Frameworks */, + A7A26A71AB271F9D402D1A12 /* Pods_Example_iOS.framework in Frameworks */, B51F21CC1F41F32C009BC2C9 /* QuickTableViewController.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -194,7 +194,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6FEC7AFD957FDD634E547C82 /* Pods_QuickTableViewControllerTests_iOS.framework in Frameworks */, + 1DF796C7F4630ACDCE1DE189 /* Pods_QuickTableViewController_iOSTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -204,10 +204,10 @@ 942C1FAD68407A74DB056C2B /* Pods */ = { isa = PBXGroup; children = ( - 965EA9FBCB752A21189A0BC0 /* Pods-Example.debug.xcconfig */, - B5C29201F434E855A1E9A3E9 /* Pods-Example.release.xcconfig */, - 332BB2E7F8C766C8BC0D5B5B /* Pods-QuickTableViewControllerTests-iOS.debug.xcconfig */, - F45E7695B97DC7347A2C89EF /* Pods-QuickTableViewControllerTests-iOS.release.xcconfig */, + A57FEA19A020A7DE44AE8BCE /* Pods-Example-iOS.debug.xcconfig */, + DE3777B435AF4EF82051BCFD /* Pods-Example-iOS.release.xcconfig */, + 4EE4E01857269725E8A86D1C /* Pods-QuickTableViewController-iOSTests.debug.xcconfig */, + 466DB8C8ACDE64B9E0EF8D74 /* Pods-QuickTableViewController-iOSTests.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -302,7 +302,7 @@ path = Source/Rows; sourceTree = SOURCE_ROOT; }; - B51F21A31F417037009BC2C9 /* Example */ = { + B51F21A31F417037009BC2C9 /* Example-iOS */ = { isa = PBXGroup; children = ( B5A37EB7202093A3009C075F /* UINibs */, @@ -312,28 +312,28 @@ B51F21B01F417037009BC2C9 /* Info.plist */, B51F21B41F41709B009BC2C9 /* LaunchScreen.xib */, ); - path = Example; + path = "Example-iOS"; sourceTree = ""; }; - B51F21C11F41E600009BC2C9 /* ExampleUITests */ = { + B51F21C11F41E600009BC2C9 /* Example-iOSUITests */ = { isa = PBXGroup; children = ( B51F21C21F41E600009BC2C9 /* ExampleUITests.swift */, B51F21C41F41E600009BC2C9 /* Info.plist */, ); - path = ExampleUITests; + path = "Example-iOSUITests"; sourceTree = ""; }; B5334F091B8CC5BD00C64A6D = { isa = PBXGroup; children = ( - B51F21A31F417037009BC2C9 /* Example */, - B51F21C11F41E600009BC2C9 /* ExampleUITests */, + B51F21A31F417037009BC2C9 /* Example-iOS */, + B51F21C11F41E600009BC2C9 /* Example-iOSUITests */, B5DB7D241C4A4BEC007B84D2 /* Frameworks */, 942C1FAD68407A74DB056C2B /* Pods */, B5334F141B8CC5BD00C64A6D /* Products */, B5334F151B8CC5BD00C64A6D /* QuickTableViewController-iOS */, - B5334F221B8CC5BD00C64A6D /* QuickTableViewControllerTests-iOS */, + B5334F221B8CC5BD00C64A6D /* QuickTableViewController-iOSTests */, B51A0E7A206934C300F42693 /* Source */, B5DD432C20639F7800AB661D /* CHANGELOG.md */, B5DD432D20639F7800AB661D /* README.md */, @@ -347,8 +347,8 @@ B5334F141B8CC5BD00C64A6D /* Products */ = { isa = PBXGroup; children = ( - B51F21A21F417037009BC2C9 /* Example.app */, - B51F21C01F41E600009BC2C9 /* ExampleUITests.xctest */, + B51F21A21F417037009BC2C9 /* Example-iOS.app */, + B51F21C01F41E600009BC2C9 /* Example-iOSUITests.xctest */, B5334F131B8CC5BD00C64A6D /* QuickTableViewController.framework */, B5334F1E1B8CC5BD00C64A6D /* QuickTableViewControllerTests.xctest */, ); @@ -364,7 +364,7 @@ path = "QuickTableViewController-iOS"; sourceTree = ""; }; - B5334F221B8CC5BD00C64A6D /* QuickTableViewControllerTests-iOS */ = { + B5334F221B8CC5BD00C64A6D /* QuickTableViewController-iOSTests */ = { isa = PBXGroup; children = ( B51A0E3320692E7100F42693 /* Assets */, @@ -375,7 +375,7 @@ B526776F1FF7EA5A00DC1362 /* CustomTypes.swift */, B5334F241B8CC5BD00C64A6D /* Info.plist */, ); - path = "QuickTableViewControllerTests-iOS"; + path = "QuickTableViewController-iOSTests"; sourceTree = ""; }; B55475721F2DC29B0027F7C1 /* Model */ = { @@ -425,8 +425,8 @@ B5DB7D241C4A4BEC007B84D2 /* Frameworks */ = { isa = PBXGroup; children = ( - 0CA13E27E7B47A3F6F9FFE5B /* Pods_Example.framework */, - 25C329622749AE5FEB731F1A /* Pods_QuickTableViewControllerTests_iOS.framework */, + BF3454E57819285B32968564 /* Pods_Example_iOS.framework */, + 51571B6D4B25D0BCCCFFBCF5 /* Pods_QuickTableViewController_iOSTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -445,9 +445,9 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - B51F21A11F417037009BC2C9 /* Example */ = { + B51F21A11F417037009BC2C9 /* Example-iOS */ = { isa = PBXNativeTarget; - buildConfigurationList = B51F21B31F417037009BC2C9 /* Build configuration list for PBXNativeTarget "Example" */; + buildConfigurationList = B51F21B31F417037009BC2C9 /* Build configuration list for PBXNativeTarget "Example-iOS" */; buildPhases = ( 9773859B01B559D1E7FEC36A /* [CP] Check Pods Manifest.lock */, B51F21BB1F417269009BC2C9 /* SwiftLint */, @@ -463,14 +463,14 @@ dependencies = ( B51F21BA1F41712E009BC2C9 /* PBXTargetDependency */, ); - name = Example; + name = "Example-iOS"; productName = Example; - productReference = B51F21A21F417037009BC2C9 /* Example.app */; + productReference = B51F21A21F417037009BC2C9 /* Example-iOS.app */; productType = "com.apple.product-type.application"; }; - B51F21BF1F41E600009BC2C9 /* ExampleUITests */ = { + B51F21BF1F41E600009BC2C9 /* Example-iOSUITests */ = { isa = PBXNativeTarget; - buildConfigurationList = B51F21C91F41E600009BC2C9 /* Build configuration list for PBXNativeTarget "ExampleUITests" */; + buildConfigurationList = B51F21C91F41E600009BC2C9 /* Build configuration list for PBXNativeTarget "Example-iOSUITests" */; buildPhases = ( B51F21BC1F41E600009BC2C9 /* Sources */, B51F21BD1F41E600009BC2C9 /* Frameworks */, @@ -479,11 +479,11 @@ buildRules = ( ); dependencies = ( - B51F21C61F41E600009BC2C9 /* PBXTargetDependency */, + B51A0E922069360500F42693 /* PBXTargetDependency */, ); - name = ExampleUITests; + name = "Example-iOSUITests"; productName = ExampleUITests; - productReference = B51F21C01F41E600009BC2C9 /* ExampleUITests.xctest */; + productReference = B51F21C01F41E600009BC2C9 /* Example-iOSUITests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; B5334F121B8CC5BD00C64A6D /* QuickTableViewController-iOS */ = { @@ -504,9 +504,9 @@ productReference = B5334F131B8CC5BD00C64A6D /* QuickTableViewController.framework */; productType = "com.apple.product-type.framework"; }; - B5334F1D1B8CC5BD00C64A6D /* QuickTableViewControllerTests-iOS */ = { + B5334F1D1B8CC5BD00C64A6D /* QuickTableViewController-iOSTests */ = { isa = PBXNativeTarget; - buildConfigurationList = B5334F2C1B8CC5BD00C64A6D /* Build configuration list for PBXNativeTarget "QuickTableViewControllerTests-iOS" */; + buildConfigurationList = B5334F2C1B8CC5BD00C64A6D /* Build configuration list for PBXNativeTarget "QuickTableViewController-iOSTests" */; buildPhases = ( D6A5837800B2AEA91500816C /* [CP] Check Pods Manifest.lock */, B5C335A91D07CBD000C706A4 /* Swift Lint */, @@ -521,7 +521,7 @@ dependencies = ( B5334F211B8CC5BD00C64A6D /* PBXTargetDependency */, ); - name = "QuickTableViewControllerTests-iOS"; + name = "QuickTableViewController-iOSTests"; productName = QuickTableViewControllerTests; productReference = B5334F1E1B8CC5BD00C64A6D /* QuickTableViewControllerTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -571,9 +571,9 @@ projectRoot = ""; targets = ( B5334F121B8CC5BD00C64A6D /* QuickTableViewController-iOS */, - B5334F1D1B8CC5BD00C64A6D /* QuickTableViewControllerTests-iOS */, - B51F21A11F417037009BC2C9 /* Example */, - B51F21BF1F41E600009BC2C9 /* ExampleUITests */, + B5334F1D1B8CC5BD00C64A6D /* QuickTableViewController-iOSTests */, + B51F21A11F417037009BC2C9 /* Example-iOS */, + B51F21BF1F41E600009BC2C9 /* Example-iOSUITests */, ); }; /* End PBXProject section */ @@ -630,7 +630,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QuickTableViewControllerTests-iOS/Pods-QuickTableViewControllerTests-iOS-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QuickTableViewController-iOSTests/Pods-QuickTableViewController-iOSTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; 7BD682369F694709705F5C93 /* [CP] Embed Pods Frameworks */ = { @@ -639,7 +639,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-QuickTableViewControllerTests-iOS/Pods-QuickTableViewControllerTests-iOS-frameworks.sh", + "${SRCROOT}/Pods/Target Support Files/Pods-QuickTableViewController-iOSTests/Pods-QuickTableViewController-iOSTests-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework", "${BUILT_PRODUCTS_DIR}/Quick/Quick.framework", ); @@ -650,7 +650,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QuickTableViewControllerTests-iOS/Pods-QuickTableViewControllerTests-iOS-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QuickTableViewController-iOSTests/Pods-QuickTableViewController-iOSTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; 9773859B01B559D1E7FEC36A /* [CP] Check Pods Manifest.lock */ = { @@ -664,7 +664,7 @@ ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Example-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-Example-iOS-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -705,7 +705,7 @@ files = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh", + "${SRCROOT}/Pods/Target Support Files/Pods-Example-iOS/Pods-Example-iOS-frameworks.sh", "${BUILT_PRODUCTS_DIR}/Weakify/Weakify.framework", ); name = "[CP] Embed Pods Frameworks"; @@ -714,7 +714,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example-iOS/Pods-Example-iOS-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; D080B9179C49F538425D9877 /* [CP] Copy Pods Resources */ = { @@ -729,7 +729,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example/Pods-Example-resources.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example-iOS/Pods-Example-iOS-resources.sh\"\n"; showEnvVarsInLog = 0; }; D6A5837800B2AEA91500816C /* [CP] Check Pods Manifest.lock */ = { @@ -743,7 +743,7 @@ ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-QuickTableViewControllerTests-iOS-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-QuickTableViewController-iOSTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -823,16 +823,16 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + B51A0E922069360500F42693 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B51F21A11F417037009BC2C9 /* Example-iOS */; + targetProxy = B51A0E912069360500F42693 /* PBXContainerItemProxy */; + }; B51F21BA1F41712E009BC2C9 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = B5334F121B8CC5BD00C64A6D /* QuickTableViewController-iOS */; targetProxy = B51F21B91F41712E009BC2C9 /* PBXContainerItemProxy */; }; - B51F21C61F41E600009BC2C9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = B51F21A11F417037009BC2C9 /* Example */; - targetProxy = B51F21C51F41E600009BC2C9 /* PBXContainerItemProxy */; - }; B5334F211B8CC5BD00C64A6D /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = B5334F121B8CC5BD00C64A6D /* QuickTableViewController-iOS */; @@ -854,7 +854,7 @@ /* Begin XCBuildConfiguration section */ B51F21B11F417037009BC2C9 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 965EA9FBCB752A21189A0BC0 /* Pods-Example.debug.xcconfig */; + baseConfigurationReference = A57FEA19A020A7DE44AE8BCE /* Pods-Example-iOS.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -864,7 +864,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = Example/Info.plist; + INFOPLIST_FILE = "Example-iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController.Example; @@ -878,7 +878,7 @@ }; B51F21B21F417037009BC2C9 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B5C29201F434E855A1E9A3E9 /* Pods-Example.release.xcconfig */; + baseConfigurationReference = DE3777B435AF4EF82051BCFD /* Pods-Example-iOS.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -887,7 +887,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = Example/Info.plist; + INFOPLIST_FILE = "Example-iOS/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController.Example; @@ -910,17 +910,18 @@ DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ""; - INFOPLIST_FILE = ExampleUITests/Info.plist; + INFOPLIST_FILE = "Example-iOSUITests/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ""; - PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController.Example.ExampleUITests; + PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController.ExampleUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; - TEST_TARGET_NAME = Example; + TEST_TARGET_NAME = "Example-iOS"; }; name = Debug; }; @@ -934,17 +935,18 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ""; - INFOPLIST_FILE = ExampleUITests/Info.plist; + INFOPLIST_FILE = "Example-iOSUITests/Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LIBRARY_SEARCH_PATHS = ""; - PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController.Example.ExampleUITests; + PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController.ExampleUITests; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; - TEST_TARGET_NAME = Example; + TEST_TARGET_NAME = "Example-iOS"; }; name = Release; }; @@ -1112,7 +1114,7 @@ }; B5334F2D1B8CC5BD00C64A6D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 332BB2E7F8C766C8BC0D5B5B /* Pods-QuickTableViewControllerTests-iOS.debug.xcconfig */; + baseConfigurationReference = 4EE4E01857269725E8A86D1C /* Pods-QuickTableViewController-iOSTests.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = ( @@ -1123,7 +1125,7 @@ "DEBUG=1", "$(inherited)", ); - INFOPLIST_FILE = "QuickTableViewControllerTests-iOS/Info.plist"; + INFOPLIST_FILE = "QuickTableViewController-iOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.github.bcylin.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = QuickTableViewControllerTests; @@ -1133,14 +1135,14 @@ }; B5334F2E1B8CC5BD00C64A6D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F45E7695B97DC7347A2C89EF /* Pods-QuickTableViewControllerTests-iOS.release.xcconfig */; + baseConfigurationReference = 466DB8C8ACDE64B9E0EF8D74 /* Pods-QuickTableViewController-iOSTests.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; FRAMEWORK_SEARCH_PATHS = ( "$(PLATFORM_DIR)/Developer/Library/Frameworks", "$(inherited)", ); - INFOPLIST_FILE = "QuickTableViewControllerTests-iOS/Info.plist"; + INFOPLIST_FILE = "QuickTableViewController-iOSTests/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.github.bcylin.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = QuickTableViewControllerTests; @@ -1152,7 +1154,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - B51F21B31F417037009BC2C9 /* Build configuration list for PBXNativeTarget "Example" */ = { + B51F21B31F417037009BC2C9 /* Build configuration list for PBXNativeTarget "Example-iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( B51F21B11F417037009BC2C9 /* Debug */, @@ -1161,7 +1163,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - B51F21C91F41E600009BC2C9 /* Build configuration list for PBXNativeTarget "ExampleUITests" */ = { + B51F21C91F41E600009BC2C9 /* Build configuration list for PBXNativeTarget "Example-iOSUITests" */ = { isa = XCConfigurationList; buildConfigurations = ( B51F21C71F41E600009BC2C9 /* Debug */, @@ -1188,7 +1190,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - B5334F2C1B8CC5BD00C64A6D /* Build configuration list for PBXNativeTarget "QuickTableViewControllerTests-iOS" */ = { + B5334F2C1B8CC5BD00C64A6D /* Build configuration list for PBXNativeTarget "QuickTableViewController-iOSTests" */ = { isa = XCConfigurationList; buildConfigurations = ( B5334F2D1B8CC5BD00C64A6D /* Debug */, diff --git a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example.xcscheme b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme similarity index 87% rename from QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example.xcscheme rename to QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme index 3ac212bc..ef9bf5da 100644 --- a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example.xcscheme +++ b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme @@ -15,8 +15,8 @@ @@ -34,8 +34,8 @@ @@ -44,8 +44,8 @@ @@ -68,8 +68,8 @@ @@ -87,8 +87,8 @@ diff --git a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/QuickTableViewController-iOS.xcscheme b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/QuickTableViewController-iOS.xcscheme index 05c942c4..85e970de 100644 --- a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/QuickTableViewController-iOS.xcscheme +++ b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/QuickTableViewController-iOS.xcscheme @@ -30,7 +30,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "B5334F1D1B8CC5BD00C64A6D" BuildableName = "QuickTableViewControllerTests.xctest" - BlueprintName = "QuickTableViewControllerTests-iOS" + BlueprintName = "QuickTableViewController-iOSTests" ReferencedContainer = "container:QuickTableViewController.xcodeproj"> @@ -50,7 +50,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "B5334F1D1B8CC5BD00C64A6D" BuildableName = "QuickTableViewControllerTests.xctest" - BlueprintName = "QuickTableViewControllerTests-iOS" + BlueprintName = "QuickTableViewController-iOSTests" ReferencedContainer = "container:QuickTableViewController.xcodeproj"> From e16afef3c444fb3982482d23bc1140f376a7588c Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 2 Apr 2018 14:21:23 +0800 Subject: [PATCH 12/23] Set -enableCodeCoverage YES only for tests --- Rakefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index 86d8dae7..c901aac4 100644 --- a/Rakefile +++ b/Rakefile @@ -8,7 +8,6 @@ namespace :ci do %(-scheme #{params[:scheme]}), %(-sdk iphonesimulator), %(-destination "name=iPhone 7,OS=latest"), - %(-enableCodeCoverage YES), %(#{params[:action]} | xcpretty -c && exit ${PIPESTATUS[0]}) ].join " " end @@ -31,7 +30,7 @@ namespace :ci do next end - sh xcodebuild(scheme: args[:scheme], action: "clean test") + sh xcodebuild(scheme: args[:scheme], action: "-enableCodeCoverage YES clean test") exit $?.exitstatus if not $?.success? end end From d95134126b042db9b3983e844b59adfe20d93f4f Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 2 Apr 2018 15:41:25 +0800 Subject: [PATCH 13/23] Fix the tests of type formats with string literals --- .../View/ReusableSpec.swift | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/QuickTableViewController-iOSTests/View/ReusableSpec.swift b/QuickTableViewController-iOSTests/View/ReusableSpec.swift index ad2d5185..8556943e 100644 --- a/QuickTableViewController-iOSTests/View/ReusableSpec.swift +++ b/QuickTableViewController-iOSTests/View/ReusableSpec.swift @@ -34,28 +34,26 @@ internal final class ReusableSpec: QuickSpec { override func spec() { describe("matches of pattern") { + let pattern = String.typeDescriptionPattern + context("invalid pattern") { it("should return an empty array") { let matches = String(describing: type(of: self)).matches(of: "\\") expect(matches).to(beEmpty()) } } - } - describe("type string") { - let pattern = String.typeDescriptionPattern - - context("custom type") { + context("type with special format") { it("should match the pattern") { - let type = String(describing: CustomCell.self) + let type = "(CustomCell in _B5334F301B8CC6AA00C64A6D)" let matches = type.matches(of: pattern) expect(matches).to(haveCount(2)) } } - context("type in the module") { + context("type with name only") { it("should not match the pattern") { - let type = String(describing: SwitchCell.self) + let type = "CustomCell" let matches = type.matches(of: pattern) expect(matches).to(beEmpty()) } From ddd4764aa97fef894e5b30e14ab7431dcca069bb Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 2 Apr 2018 18:24:22 +0800 Subject: [PATCH 14/23] Update to Xcode recommended settings --- .../project.pbxproj | 18 ++++++++++++------ .../xcschemes/Example-iOS.xcscheme | 4 +--- .../QuickTableViewController-iOS.xcscheme | 8 +++----- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ 4 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 QuickTableViewController.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 9d6f2d96..c711f823 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -533,7 +533,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 0930; ORGANIZATIONNAME = bcylin; TargetAttributes = { B51F21A11F417037009BC2C9 = { @@ -553,7 +553,7 @@ }; B5334F1D1B8CC5BD00C64A6D = { CreatedOnToolsVersion = 6.4; - LastSwiftMigration = 0800; + LastSwiftMigration = 0930; }; }; }; @@ -964,12 +964,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 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_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -1005,7 +1007,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -1027,12 +1029,14 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 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_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -1059,7 +1063,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; @@ -1129,7 +1133,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "io.github.bcylin.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = QuickTableViewControllerTests; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1147,7 +1152,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "io.github.bcylin.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = QuickTableViewControllerTests; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme index ef9bf5da..12c01c22 100644 --- a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme +++ b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme @@ -1,6 +1,6 @@ + codeCoverageEnabled = "YES" + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -71,7 +70,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/QuickTableViewController.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/QuickTableViewController.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/QuickTableViewController.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + From 4d8d418a3478170396139cda4d3cd1256b471786 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 31 Mar 2018 15:27:09 +0800 Subject: [PATCH 15/23] Check Swift version to use different methods at compile time --- Source/Protocol/Reusable.swift | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/Protocol/Reusable.swift b/Source/Protocol/Reusable.swift index 02d40c00..8e28a12c 100644 --- a/Source/Protocol/Reusable.swift +++ b/Source/Protocol/Reusable.swift @@ -53,7 +53,11 @@ internal extension String { internal func matches(of pattern: String) -> [String] { let regex = try? NSRegularExpression(pattern: pattern, options: .caseInsensitive) - let fullText = NSRange(location: 0, length: count) + #if swift(>=4) + let fullText = NSRange(location: 0, length: count) + #else + let fullText = NSRange(location: 0, length: characters.count) + #endif guard let matches = regex?.matches(in: self, options: [], range: fullText) else { return [] @@ -61,7 +65,11 @@ internal extension String { return matches.reduce([]) { accumulator, match in accumulator + (0..=4) + return (self as NSString).substring(with: match.range(at: $0)) + #else + return (self as NSString).substring(with: match.rangeAt($0)) + #endif } } } From d1a68fd96ea531444d82b42bfb42f3dd0e87611f Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 2 Apr 2018 19:21:27 +0800 Subject: [PATCH 16/23] Bump version to 0.9.0 --- .jazzy.yml | 2 +- Example-iOS/Info.plist | 2 +- Example-iOSUITests/Info.plist | 2 +- QuickTableViewController-iOS/Info.plist | 2 +- QuickTableViewController-iOSTests/Info.plist | 2 +- QuickTableViewController.podspec | 2 +- README.md | 10 ++++++---- 7 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.jazzy.yml b/.jazzy.yml index 13e230d1..3a1e95c4 100644 --- a/.jazzy.yml +++ b/.jazzy.yml @@ -5,7 +5,7 @@ github_url: https://github.com/bcylin/QuickTableViewController github_file_prefix: https://github.com/bcylin/QuickTableViewController/blob/develop xcodebuild_arguments: [-project, QuickTableViewController.xcodeproj, -scheme, QuickTableViewController-iOS] module: QuickTableViewController -module_version: 0.8.4 +module_version: 0.9.0 output: docs/output theme: fullwidth skip_undocumented: true diff --git a/Example-iOS/Info.plist b/Example-iOS/Info.plist index 1d2ac64b..9b882036 100644 --- a/Example-iOS/Info.plist +++ b/Example-iOS/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.8.4 + 0.9.0 CFBundleVersion 101 LSRequiresIPhoneOS diff --git a/Example-iOSUITests/Info.plist b/Example-iOSUITests/Info.plist index acdafe34..bbe19c41 100644 --- a/Example-iOSUITests/Info.plist +++ b/Example-iOSUITests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.8.4 + 0.9.0 CFBundleVersion 1 diff --git a/QuickTableViewController-iOS/Info.plist b/QuickTableViewController-iOS/Info.plist index 9bd3d8e6..76d3d186 100644 --- a/QuickTableViewController-iOS/Info.plist +++ b/QuickTableViewController-iOS/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.8.4 + 0.9.0 CFBundleSignature ???? CFBundleVersion diff --git a/QuickTableViewController-iOSTests/Info.plist b/QuickTableViewController-iOSTests/Info.plist index 2cd2cccb..0c4fbf23 100644 --- a/QuickTableViewController-iOSTests/Info.plist +++ b/QuickTableViewController-iOSTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 0.8.4 + 0.9.0 CFBundleSignature ???? CFBundleVersion diff --git a/QuickTableViewController.podspec b/QuickTableViewController.podspec index dc70ca7d..6f99d539 100644 --- a/QuickTableViewController.podspec +++ b/QuickTableViewController.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "QuickTableViewController" - s.version = "0.8.4" + s.version = "0.9.0" s.summary = "A simple way to create a UITableView for settings." s.screenshots = "https://bcylin.github.io/QuickTableViewController/img/screenshot-1.png", "https://bcylin.github.io/QuickTableViewController/img/screenshot-2.png" diff --git a/README.md b/README.md index cf3305c2..54237624 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/QuickTableViewController.svg)](https://cocoapods.org/pods/QuickTableViewController) ![Platform](https://img.shields.io/cocoapods/p/QuickTableViewController.svg) [![codecov](https://codecov.io/gh/bcylin/QuickTableViewController/branch/master/graph/badge.svg)](https://codecov.io/gh/bcylin/QuickTableViewController) -![Swift 4.0](https://img.shields.io/badge/Swift-4.0-orange.svg) +![Swift 4.1](https://img.shields.io/badge/Swift-4.1-orange.svg) A simple way to create a table view for settings, including: @@ -139,9 +139,10 @@ OptionRow(title: "Option", isSelected: true, action: { (sender: Row) in }) All rows must conform to [`Row`](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/Row.swift) and [`RowStyle`](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/RowStyle.swift). Addtional interface to work with specific types of rows are represented as different protocols: -* `Switchable` -* `Tappable` -* `OptionSelectable` +* `NavigationRowCompatible` +* `OptionRowCompatible` +* `SwitchRowCompatible` +* `TapActionRowCompatible` ### Cell Classes @@ -229,6 +230,7 @@ QuickTableViewController | iOS | Xcode | Swift `~> 0.6.0` | 8.0+ | 8.3 | ![Swift 3.1](https://img.shields.io/badge/Swift-3.1-orange.svg) `~> 0.7.0` | 8.0+ | 9.0 | ![Swift 3.2](https://img.shields.io/badge/Swift-3.2-orange.svg) `~> 0.8.0` | 8.0+ | 9.1 | ![Swift 4.0](https://img.shields.io/badge/Swift-4.0-orange.svg) +`~> 0.9.0` | 8.0+ | 9.3 | ![Swift 4.1](https://img.shields.io/badge/Swift-4.1-orange.svg) ## Installation From fd47b97ce4f7d79900cbc56694b1a9116c743d70 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 2 Apr 2018 20:05:22 +0800 Subject: [PATCH 17/23] Move the Row compatibility protocols into one file --- CHANGELOG.md | 18 ++++++++-- .../project.pbxproj | 20 +++-------- README.md | 2 +- Source/Protocol/NavigationRowCompatible.swift | 30 ---------------- Source/Protocol/OptionRowCompatible.swift | 35 ------------------- Source/Protocol/Row.swift | 4 +++ ...owCompatible.swift => RowCompatible.swift} | 19 ++++++++-- Source/Protocol/TapActionRowCompatible.swift | 30 ---------------- 8 files changed, 41 insertions(+), 117 deletions(-) delete mode 100644 Source/Protocol/NavigationRowCompatible.swift delete mode 100644 Source/Protocol/OptionRowCompatible.swift rename Source/Protocol/{SwitchRowCompatible.swift => RowCompatible.swift} (70%) delete mode 100644 Source/Protocol/TapActionRowCompatible.swift diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b23d346..d1de2736 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,22 @@ #### Breaking -* Change the `Icon` type from struct to enum -* Rename the protocols that define specific rows regardless of their associated cell types +* Change the `Icon` type (since [v0.2.0](#v020)) from struct to enum: + + ```swift + enum Icon { + case named(String) + case image(UIImage) + case images(normal: UIImage, highlighted: UIImage) + } + ``` + +* Rename the protocols (introduced in [v0.8.1](#v081)) that define specific rows regardless of their associated cell types: + + * `NavigationRowCompatible` + * `OptionSelectable` → `OptionRowCompatible` + * `Switchable` → `SwitchRowCompatible` + * `Tappable` → `TapActionRowCompatible` ## v0.8.4 diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index c711f823..031a0690 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -24,9 +24,7 @@ B5334F191B8CC5BD00C64A6D /* QuickTableViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = B5334F181B8CC5BD00C64A6D /* QuickTableViewController.h */; settings = {ATTRIBUTES = (Public, ); }; }; B5334F301B8CC6AA00C64A6D /* QuickTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */; }; B536C7F81F4AAF9900DAC4AA /* ReusableSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B536C7F61F4AAF7C00DAC4AA /* ReusableSpec.swift */; }; - B5374C901FDD7AF800A3EA28 /* OptionRowCompatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5374C8F1FDD7AF700A3EA28 /* OptionRowCompatible.swift */; }; - B5374C931FDD7B3E00A3EA28 /* SwitchRowCompatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5374C911FDD7B3D00A3EA28 /* SwitchRowCompatible.swift */; }; - B5374C941FDD7B3E00A3EA28 /* TapActionRowCompatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5374C921FDD7B3E00A3EA28 /* TapActionRowCompatible.swift */; }; + B5374C901FDD7AF800A3EA28 /* RowCompatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5374C8F1FDD7AF700A3EA28 /* RowCompatible.swift */; }; B55475751F2DC3C00027F7C1 /* Configurable.swift in Sources */ = {isa = PBXBuildFile; fileRef = B55475741F2DC3C00027F7C1 /* Configurable.swift */; }; B578B5091C5673240021F7C3 /* icon.png in Resources */ = {isa = PBXBuildFile; fileRef = B578B5071C5673240021F7C3 /* icon.png */; }; B578B50A1C5673240021F7C3 /* icon-highlighted.png in Resources */ = {isa = PBXBuildFile; fileRef = B578B5081C5673240021F7C3 /* icon-highlighted.png */; }; @@ -46,7 +44,6 @@ B5DB7D311C4B9ACB007B84D2 /* TapActionRowSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DB7D301C4B9ACB007B84D2 /* TapActionRowSpec.swift */; }; B5DB7D351C4CBB74007B84D2 /* SectionSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DB7D341C4CBB74007B84D2 /* SectionSpec.swift */; }; B5DB94351BE117EE00E2CEDE /* SubtitleSpec.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DB94341BE117EE00E2CEDE /* SubtitleSpec.swift */; }; - B5DD432B20639E1400AB661D /* NavigationRowCompatible.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5DD432A20639E1400AB661D /* NavigationRowCompatible.swift */; }; B5E029211DC7A39200B5C90E /* Section.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E029201DC7A39200B5C90E /* Section.swift */; }; B5E029231DC8B3EC00B5C90E /* Icon.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E029221DC8B3EC00B5C90E /* Icon.swift */; }; B5E619CF1F454CF0005200E1 /* RadioSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E619CE1F454CF0005200E1 /* RadioSection.swift */; }; @@ -125,9 +122,7 @@ B5334F241B8CC5BD00C64A6D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B5334F2F1B8CC6AA00C64A6D /* QuickTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = QuickTableViewController.swift; path = Source/QuickTableViewController.swift; sourceTree = SOURCE_ROOT; }; B536C7F61F4AAF7C00DAC4AA /* ReusableSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReusableSpec.swift; sourceTree = ""; }; - B5374C8F1FDD7AF700A3EA28 /* OptionRowCompatible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OptionRowCompatible.swift; path = Source/Protocol/OptionRowCompatible.swift; sourceTree = SOURCE_ROOT; }; - B5374C911FDD7B3D00A3EA28 /* SwitchRowCompatible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwitchRowCompatible.swift; path = Source/Protocol/SwitchRowCompatible.swift; sourceTree = SOURCE_ROOT; }; - B5374C921FDD7B3E00A3EA28 /* TapActionRowCompatible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TapActionRowCompatible.swift; path = Source/Protocol/TapActionRowCompatible.swift; sourceTree = SOURCE_ROOT; }; + B5374C8F1FDD7AF700A3EA28 /* RowCompatible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RowCompatible.swift; path = Source/Protocol/RowCompatible.swift; sourceTree = SOURCE_ROOT; }; B55475741F2DC3C00027F7C1 /* Configurable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Configurable.swift; path = Source/Protocol/Configurable.swift; sourceTree = SOURCE_ROOT; }; B578B5071C5673240021F7C3 /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = ""; }; B578B5081C5673240021F7C3 /* icon-highlighted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon-highlighted.png"; sourceTree = ""; }; @@ -147,7 +142,6 @@ B5DB7D301C4B9ACB007B84D2 /* TapActionRowSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TapActionRowSpec.swift; sourceTree = ""; }; B5DB7D341C4CBB74007B84D2 /* SectionSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SectionSpec.swift; sourceTree = ""; }; B5DB94341BE117EE00E2CEDE /* SubtitleSpec.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SubtitleSpec.swift; sourceTree = ""; }; - B5DD432A20639E1400AB661D /* NavigationRowCompatible.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = NavigationRowCompatible.swift; path = Source/Protocol/NavigationRowCompatible.swift; sourceTree = SOURCE_ROOT; }; B5DD432C20639F7800AB661D /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = ""; }; B5DD432D20639F7800AB661D /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; B5E029201DC7A39200B5C90E /* Section.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Section.swift; path = Source/Model/Section.swift; sourceTree = SOURCE_ROOT; }; @@ -216,13 +210,10 @@ isa = PBXGroup; children = ( B55475741F2DC3C00027F7C1 /* Configurable.swift */, - B5DD432A20639E1400AB661D /* NavigationRowCompatible.swift */, - B5374C8F1FDD7AF700A3EA28 /* OptionRowCompatible.swift */, B522E1DF1F4AA750004DA5AD /* Reusable.swift */, B5EC18221B95FD7F0015C665 /* Row.swift */, + B5374C8F1FDD7AF700A3EA28 /* RowCompatible.swift */, B50E73841F2E1BC900481910 /* RowStyle.swift */, - B5374C911FDD7B3D00A3EA28 /* SwitchRowCompatible.swift */, - B5374C921FDD7B3E00A3EA28 /* TapActionRowCompatible.swift */, ); name = Protocol; path = "QuickTableViewController-iOS"; @@ -780,22 +771,19 @@ B55475751F2DC3C00027F7C1 /* Configurable.swift in Sources */, B5E029231DC8B3EC00B5C90E /* Icon.swift in Sources */, B5F0FFE81E9CC6E8007BF1C9 /* NavigationRow.swift in Sources */, - B5DD432B20639E1400AB661D /* NavigationRowCompatible.swift in Sources */, B5E619D21F454EEF005200E1 /* OptionRow.swift in Sources */, - B5374C901FDD7AF800A3EA28 /* OptionRowCompatible.swift in Sources */, B5334F301B8CC6AA00C64A6D /* QuickTableViewController.swift in Sources */, B5E619CF1F454CF0005200E1 /* RadioSection.swift in Sources */, B522E1E01F4AA750004DA5AD /* Reusable.swift in Sources */, B5EC18231B95FD7F0015C665 /* Row.swift in Sources */, + B5374C901FDD7AF800A3EA28 /* RowCompatible.swift in Sources */, B50E73851F2E1BC900481910 /* RowStyle.swift in Sources */, B5E029211DC7A39200B5C90E /* Section.swift in Sources */, B5F0FFEE1E9CC73D007BF1C9 /* Subtitle.swift in Sources */, B5F0FFE61E9CC69C007BF1C9 /* SwitchCell.swift in Sources */, B5F0FFEA1E9CC6F9007BF1C9 /* SwitchRow.swift in Sources */, - B5374C931FDD7B3E00A3EA28 /* SwitchRowCompatible.swift in Sources */, B595627B1B9758BC00D6DAB1 /* TapActionCell.swift in Sources */, B5F0FFEC1E9CC72D007BF1C9 /* TapActionRow.swift in Sources */, - B5374C941FDD7B3E00A3EA28 /* TapActionRowCompatible.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/README.md b/README.md index 54237624..da49ae49 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ OptionRow(title: "Option", isSelected: true, action: { (sender: Row) in }) ### Rows -All rows must conform to [`Row`](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/Row.swift) and [`RowStyle`](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/RowStyle.swift). Addtional interface to work with specific types of rows are represented as different protocols: +All rows must conform to [`Row`](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/Row.swift) and [`RowStyle`](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/RowStyle.swift). Addtional interface to work with specific types of rows are represented as different [protocols](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/RowCompatible.swift): * `NavigationRowCompatible` * `OptionRowCompatible` diff --git a/Source/Protocol/NavigationRowCompatible.swift b/Source/Protocol/NavigationRowCompatible.swift deleted file mode 100644 index 54cf0302..00000000 --- a/Source/Protocol/NavigationRowCompatible.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// NavigationRowCompatible.swift -// QuickTableViewController -// -// Created by Ben on 22/03/2018. -// Copyright © 2018 bcylin. -// -// 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 Foundation - -/// This protocol defines the compatible interface of a `NavigationRow` regardless of its associated cell type. -public protocol NavigationRowCompatible: class, Row, RowStyle {} diff --git a/Source/Protocol/OptionRowCompatible.swift b/Source/Protocol/OptionRowCompatible.swift deleted file mode 100644 index 76c0382d..00000000 --- a/Source/Protocol/OptionRowCompatible.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// OptionRowCompatible.swift -// QuickTableViewController -// -// Created by Ben on 10/12/2017. -// Copyright © 2017 bcylin. -// -// 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 Foundation - -/// This protocol defines the compatible interface of an `OptionRow` regardless of its associated cell type. -public protocol OptionRowCompatible: class, Row, RowStyle { - - /// The state of selection. - var isSelected: Bool { get set } - -} diff --git a/Source/Protocol/Row.swift b/Source/Protocol/Row.swift index baa349ac..236b9d2f 100644 --- a/Source/Protocol/Row.swift +++ b/Source/Protocol/Row.swift @@ -28,12 +28,16 @@ import Foundation /// Any type that conforms to this protocol is capable of representing a row in a table view. public protocol Row { + /// The title text of the row. var title: String { get } + /// The subtitle text of the row. var subtitle: Subtitle? { get } + /// A closure related to the action of the row. var action: ((Row) -> Void)? { get } + } diff --git a/Source/Protocol/SwitchRowCompatible.swift b/Source/Protocol/RowCompatible.swift similarity index 70% rename from Source/Protocol/SwitchRowCompatible.swift rename to Source/Protocol/RowCompatible.swift index f7cf4210..a3dff4cc 100644 --- a/Source/Protocol/SwitchRowCompatible.swift +++ b/Source/Protocol/RowCompatible.swift @@ -1,5 +1,5 @@ // -// SwitchRowCompatible.swift +// RowCompatible.swift // QuickTableViewController // // Created by Ben on 10/12/2017. @@ -26,10 +26,23 @@ import Foundation +/// This protocol defines the compatible interface of a `NavigationRow` regardless of its associated cell type. +public protocol NavigationRowCompatible: class, Row, RowStyle {} + + +/// This protocol defines the compatible interface of a `TapActionRow` regardless of its associated cell type. +public protocol TapActionRowCompatible: Row, RowStyle {} + + +/// This protocol defines the compatible interface of an `OptionRow` regardless of its associated cell type. +public protocol OptionRowCompatible: class, Row, RowStyle { + /// The state of selection. + var isSelected: Bool { get set } +} + + /// This protocol defines the compatible interface of a `SwitchRow` regardless of its associated cell type. public protocol SwitchRowCompatible: class, Row, RowStyle { - /// The state of the switch. var switchValue: Bool { get set } - } diff --git a/Source/Protocol/TapActionRowCompatible.swift b/Source/Protocol/TapActionRowCompatible.swift deleted file mode 100644 index f70896de..00000000 --- a/Source/Protocol/TapActionRowCompatible.swift +++ /dev/null @@ -1,30 +0,0 @@ -// -// TapActionRowCompatible.swift -// QuickTableViewController -// -// Created by Ben on 10/12/2017. -// Copyright © 2017 bcylin. -// -// 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 Foundation - -/// This protocol defines the compatible interface of a `TapActionRow` regardless of its associated cell type. -public protocol TapActionRowCompatible: Row, RowStyle {} From dc085042524151794f1d4d1714d066d8aa2c0edf Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 2 Apr 2018 20:16:07 +0800 Subject: [PATCH 18/23] Simplify the cell image configuration --- Source/Protocol/Configurable.swift | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Source/Protocol/Configurable.swift b/Source/Protocol/Configurable.swift index 723bb84a..47a7af6f 100644 --- a/Source/Protocol/Configurable.swift +++ b/Source/Protocol/Configurable.swift @@ -43,17 +43,8 @@ extension UITableViewCell { accessoryView = nil accessoryType = row.accessoryType - if let icon = row.icon { - if let image = icon.image { - imageView?.image = image - } - if let image = icon.highlightedImage { - imageView?.highlightedImage = image - } - } else { - imageView?.image = nil - imageView?.highlightedImage = nil - } + imageView?.image = row.icon?.image + imageView?.highlightedImage = row.icon?.highlightedImage } } From dcb8afc69739c8cc2d8b3e83422c3737beeb9f90 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 3 Apr 2018 13:25:29 +0800 Subject: [PATCH 19/23] Update README [ci skip] --- README.md | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index da49ae49..dde583c2 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ A simple way to create a table view for settings, including: * Table view cells with center aligned text for tap actions * A section that provides mutually exclusive options * Actions performed when the row reacts to the user interaction -* Customizable table view cell image, cell style and cell accessory type +* Customizable table view cell image, cell style and accessory type @@ -95,7 +95,7 @@ NavigationRow(title: "Cell with image", subtitle: .none, icon: icon) * The `action` will be invoked when the related table view cell is selected. ```swift -NavigationRow(title: "Navigation cell", subtitle: .None, action: { (sender: Row) in }) +NavigationRow(title: "Navigation cell", subtitle: .none, action: { (sender: Row) in }) ``` ### SwitchRow @@ -129,15 +129,14 @@ TapActionRow(title: "Tap action", action: { (sender: Row) in }) OptionRow(title: "Option", isSelected: true, action: { (sender: Row) in }) ``` -* `OptionRow` can be used with or without `RadioSection`, which guarantees that there's only one option is selected. -* `RadioSection` allows all options unselected by default. Setting `alwaysSelectsOneOption` to true will preserve one selected option. -* `selectedOption` is available as the result of selection in `RadioSection`. +* `OptionRow` can be used with or without `RadioSection`, which allows only one selection. +* `RadioSection` allows all options unselected by default. Set `alwaysSelectsOneOption` to true to keep one option selected. ## Customization ### Rows -All rows must conform to [`Row`](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/Row.swift) and [`RowStyle`](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/RowStyle.swift). Addtional interface to work with specific types of rows are represented as different [protocols](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/RowCompatible.swift): +All rows must conform to [`Row`](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/Row.swift) and [`RowStyle`](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/RowStyle.swift). Additional interface to work with specific types of rows are represented as different [protocols](https://github.com/bcylin/QuickTableViewController/blob/develop/Source/Protocol/RowCompatible.swift): * `NavigationRowCompatible` * `OptionRowCompatible` @@ -149,16 +148,16 @@ All rows must conform to [`Row`](https://github.com/bcylin/QuickTableViewControl A customized table view cell type can be specified to rows during initialization. ```swift -// NavigationRow, using UITableViewCell if not specified. +// Default is UITableViewCell. NavigationRow(title: "Navigation", subtitle: .none) -// SwitchRow, using SwitchCell if not specified. +// Default is SwitchCell. SwitchRow(title: "Switch", switchValue: true, action: { _ in }) -// TapActionRow, using TapActionCell if not specified. +// Default is TapActionCell. TapActionRow(title: "Tap", action: { _ in }) -// OptionRow, using UITableViewCell if not specified. +// Default is UITableViewCell. OptionRow(title: "Option", isSelected: true, action: { _ in }) ``` @@ -179,7 +178,9 @@ let action: (Row) -> Void = { ### Overwrite Default Configuration -Table view cell classes that conform to `Configurable` can implement additional configuration to set up the cell during `tableView(_:cellForRowAt:)`: +You can use `register(_:forCellReuseIdentifier:)` to specify custom cell types for the [table view]((https://github.com/bcylin/QuickTableViewController/blob/develop/Source/QuickTableViewController.swift#L104)) to use. See [CustomizationViewController](https://github.com/bcylin/QuickTableViewController/blob/develop/Example/ViewControllers/CustomizationViewController.swift) for the cell reuse identifiers of different rows. + +Table view cell classes that conform to `Configurable` can take the customization during `tableView(_:cellForRowAt:)`: ```swift protocol Configurable { @@ -187,7 +188,7 @@ protocol Configurable { } ``` -Other setups can also be added to each row using the `customize` closure: +Additional setups can also be added to each row using the `customize` closure: ```swift protocol RowStyle { @@ -195,7 +196,7 @@ protocol RowStyle { } ``` -You can also use `register(_:forCellReuseIdentifier:)` to specify custom cell types for the [table view]((https://github.com/bcylin/QuickTableViewController/blob/develop/Source/QuickTableViewController.swift#L104)) to use. See [CustomizationViewController](https://github.com/bcylin/QuickTableViewController/blob/develop/Example/ViewControllers/CustomizationViewController.swift) for the cell reuse identifiers of different rows. +The `customize` closure overwrites the `Configurable` changes. ### UIAppearance @@ -263,10 +264,6 @@ git submodule add -b master git@github.com:bcylin/QuickTableViewController.git D * Drag **QuickTableViewController.xcodeproj** to your app project as a subproject. * On your application target's **Build Phases** settings tab, add **QuickTableViewController-iOS** to **Target Dependencies**. -## Contact - -[![Twitter](https://img.shields.io/badge/twitter-@bcylin-blue.svg?style=flat)](https://twitter.com/bcylin) - ## License QuickTableViewController is released under the MIT license. From db44c1b6bdfcaaa692f5e55cc33a84829c739abc Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 3 Apr 2018 14:07:47 +0800 Subject: [PATCH 20/23] Fix the protocol for NavigationRow --- .../Row/NavigationRowSpec.swift | 5 ++++- .../Row/OptionRowSpec.swift | 11 ++++++++--- .../Row/SwitchRowSpec.swift | 5 ++++- .../Row/TapActionRowSpec.swift | 5 ++++- Source/Protocol/RowCompatible.swift | 2 +- Source/Rows/NavigationRow.swift | 2 +- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/QuickTableViewController-iOSTests/Row/NavigationRowSpec.swift b/QuickTableViewController-iOSTests/Row/NavigationRowSpec.swift index f6c784cb..8c0bcab2 100644 --- a/QuickTableViewController-iOSTests/Row/NavigationRowSpec.swift +++ b/QuickTableViewController-iOSTests/Row/NavigationRowSpec.swift @@ -43,11 +43,14 @@ internal final class NavigationRowSpec: QuickSpec { expect(row.subtitle) == subtitle expect(row.icon) == icon expect(row.cellReuseIdentifier) == "UITableViewCell.subtitle" - expect(row.action).notTo(beNil()) row.action?(row) expect(invoked) == true } + + it("should conform to the protocol") { + expect(row).to(beAKindOf(NavigationRowCompatible.self)) + } } describe("cellReuseIdentifier") { diff --git a/QuickTableViewController-iOSTests/Row/OptionRowSpec.swift b/QuickTableViewController-iOSTests/Row/OptionRowSpec.swift index 4dd34670..a9b23517 100644 --- a/QuickTableViewController-iOSTests/Row/OptionRowSpec.swift +++ b/QuickTableViewController-iOSTests/Row/OptionRowSpec.swift @@ -42,7 +42,9 @@ internal final class OptionRowSpec: QuickSpec { expect(row.title) == "title" expect(row.subtitle).to(beNil()) expect(row.isSelected) == true - expect(row.action).notTo(beNil()) + + row.action?(row) + expect(invoked) == true // RowStyle expect(row.cellReuseIdentifier) == "UITableViewCell" @@ -51,9 +53,10 @@ internal final class OptionRowSpec: QuickSpec { expect(row.accessoryType) == UITableViewCellAccessoryType.checkmark expect(row.isSelectable) == true expect(row.customize).to(beNil()) + } - row.action?(row) - expect(invoked) == true + it("should conform to the protocol") { + expect(row).to(beAKindOf(OptionRowCompatible.self)) } } @@ -103,6 +106,7 @@ internal final class OptionRowSpec: QuickSpec { it("should invoke the action closure") { row.isSelected = true + expect(row.accessoryType) == UITableViewCellAccessoryType.checkmark expect(invoked).toEventually(beTrue()) } } @@ -113,6 +117,7 @@ internal final class OptionRowSpec: QuickSpec { it("should not invoke the action closure") { row.isSelected = false + expect(row.accessoryType) == UITableViewCellAccessoryType.none expect(invoked).toEventually(beFalse()) } } diff --git a/QuickTableViewController-iOSTests/Row/SwitchRowSpec.swift b/QuickTableViewController-iOSTests/Row/SwitchRowSpec.swift index 4a033be9..40ece34c 100644 --- a/QuickTableViewController-iOSTests/Row/SwitchRowSpec.swift +++ b/QuickTableViewController-iOSTests/Row/SwitchRowSpec.swift @@ -39,11 +39,14 @@ internal final class SwitchRowSpec: QuickSpec { expect(row.title) == "title" expect(row.switchValue) == true expect(row.cellReuseIdentifier) == "SwitchCell" - expect(row.action).notTo(beNil()) row.action?(row) expect(invoked) == true } + + it("should conform to the protocol") { + expect(row).to(beAKindOf(SwitchRowCompatible.self)) + } } describe("equatable") { diff --git a/QuickTableViewController-iOSTests/Row/TapActionRowSpec.swift b/QuickTableViewController-iOSTests/Row/TapActionRowSpec.swift index 23e47de2..88f66d0b 100644 --- a/QuickTableViewController-iOSTests/Row/TapActionRowSpec.swift +++ b/QuickTableViewController-iOSTests/Row/TapActionRowSpec.swift @@ -38,11 +38,14 @@ internal final class TapActionRowSpec: QuickSpec { it("should initialize with given parameters") { expect(row.title) == "title" expect(row.cellReuseIdentifier) == "TapActionCell" - expect(row.action).notTo(beNil()) row.action?(row) expect(invoked) == true } + + it("should conform to the protocol") { + expect(row).to(beAKindOf(TapActionRowCompatible.self)) + } } describe("equatable") { diff --git a/Source/Protocol/RowCompatible.swift b/Source/Protocol/RowCompatible.swift index a3dff4cc..6a28c504 100644 --- a/Source/Protocol/RowCompatible.swift +++ b/Source/Protocol/RowCompatible.swift @@ -27,7 +27,7 @@ import Foundation /// This protocol defines the compatible interface of a `NavigationRow` regardless of its associated cell type. -public protocol NavigationRowCompatible: class, Row, RowStyle {} +public protocol NavigationRowCompatible: Row, RowStyle {} /// This protocol defines the compatible interface of a `TapActionRow` regardless of its associated cell type. diff --git a/Source/Rows/NavigationRow.swift b/Source/Rows/NavigationRow.swift index a0c59e4b..5b1195d7 100644 --- a/Source/Rows/NavigationRow.swift +++ b/Source/Rows/NavigationRow.swift @@ -27,7 +27,7 @@ import UIKit /// A class that represents a row that triggers certain navigation when selected. -open class NavigationRow: Row, RowStyle, Equatable { +open class NavigationRow: NavigationRowCompatible, Equatable { // MARK: - Initializer From 835b966423bed65d1301535173d69ea12e5a2b0e Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 5 Apr 2018 14:56:35 +0800 Subject: [PATCH 21/23] String 'characters' is deprecated since Swift 3.2 --- Source/Protocol/Reusable.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Protocol/Reusable.swift b/Source/Protocol/Reusable.swift index 8e28a12c..1c3a98bd 100644 --- a/Source/Protocol/Reusable.swift +++ b/Source/Protocol/Reusable.swift @@ -53,7 +53,7 @@ internal extension String { internal func matches(of pattern: String) -> [String] { let regex = try? NSRegularExpression(pattern: pattern, options: .caseInsensitive) - #if swift(>=4) + #if swift(>=3.2) let fullText = NSRange(location: 0, length: count) #else let fullText = NSRange(location: 0, length: characters.count) From 2072041998de519719843c14714fe2ce4266d1bd Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 5 Apr 2018 14:57:24 +0800 Subject: [PATCH 22/23] Update dependencies with CocoaPods 1.5.0 --- Gemfile.lock | 30 ++++++++--------- Podfile | 4 +-- Podfile.lock | 24 ++++++++------ .../project.pbxproj | 32 ------------------- 4 files changed, 31 insertions(+), 59 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index d8f4d068..537d4025 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: http://rubygems.org/ specs: - CFPropertyList (2.3.6) + CFPropertyList (3.0.0) activesupport (4.2.10) i18n (~> 0.7) minitest (~> 5.1) @@ -15,12 +15,12 @@ GEM cork nap open4 (~> 1.3) - cocoapods (1.4.0) + cocoapods (1.5.0) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.4.0) + cocoapods-core (= 1.5.0) cocoapods-deintegrate (>= 1.0.2, < 2.0) - cocoapods-downloader (>= 1.1.3, < 2.0) + cocoapods-downloader (>= 1.2.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) cocoapods-search (>= 1.0.0, < 2.0) cocoapods-stats (>= 1.0.0, < 2.0) @@ -30,16 +30,16 @@ GEM escape (~> 0.0.4) fourflusher (~> 2.0.1) gh_inspector (~> 1.0) - molinillo (~> 0.6.4) + molinillo (~> 0.6.5) nap (~> 1.0) ruby-macho (~> 1.1) - xcodeproj (>= 1.5.4, < 2.0) - cocoapods-core (1.4.0) + xcodeproj (>= 1.5.7, < 2.0) + cocoapods-core (1.5.0) activesupport (>= 4.0.2, < 6) fuzzy_match (~> 2.0.4) nap (~> 1.0) cocoapods-deintegrate (1.0.2) - cocoapods-downloader (1.1.3) + cocoapods-downloader (1.2.0) cocoapods-plugins (1.0.0) nap cocoapods-search (1.0.0) @@ -88,10 +88,10 @@ GEM kramdown (1.16.2) liferaft (0.0.6) minitest (5.11.3) - molinillo (0.6.4) + molinillo (0.6.5) multipart-post (2.0.0) mustache (0.99.8) - nanaimo (0.2.3) + nanaimo (0.2.5) nap (1.1.0) netrc (0.11.0) no_proxy_fix (0.1.2) @@ -99,14 +99,14 @@ GEM sawyer (~> 0.8.0, >= 0.5.3) open4 (1.3.4) public_suffix (3.0.2) - rake (12.3.0) + rake (12.3.1) rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) redcarpet (3.4.0) rouge (2.0.7) ruby-macho (1.1.0) - sass (3.5.5) + sass (3.5.6) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) @@ -123,12 +123,12 @@ GEM unicode-display_width (1.3.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.5.6) - CFPropertyList (~> 2.3.3) + xcodeproj (1.5.7) + CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.2) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.3) + nanaimo (~> 0.2.4) xcpretty (0.2.8) rouge (~> 2.0.7) diff --git a/Podfile b/Podfile index 43ad5cc1..561b63b1 100644 --- a/Podfile +++ b/Podfile @@ -5,11 +5,11 @@ workspace "QuickTableViewController" project "QuickTableViewController" target "QuickTableViewController-iOSTests" do - pod "Nimble", git: "https://github.com/Quick/Nimble.git", tag: "v7.0.2" + pod "Nimble", git: "https://github.com/Quick/Nimble.git", tag: "v7.0.3" pod "Quick", git: "https://github.com/Quick/Quick.git", tag: "v1.2.0" end target "Example-iOS" do - pod "SwiftLint", "0.23.1" + pod "SwiftLint", "0.25.0" pod "Weakify", git: "https://github.com/klundberg/Weakify.git", tag: "v0.4.0" end diff --git a/Podfile.lock b/Podfile.lock index 480342b5..fec0b00c 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,19 +1,23 @@ PODS: - - Nimble (7.0.2) + - Nimble (7.0.3) - Quick (1.2.0) - - SwiftLint (0.23.1) + - SwiftLint (0.25.0) - Weakify (0.4.0) DEPENDENCIES: - - Nimble (from `https://github.com/Quick/Nimble.git`, tag `v7.0.2`) + - Nimble (from `https://github.com/Quick/Nimble.git`, tag `v7.0.3`) - Quick (from `https://github.com/Quick/Quick.git`, tag `v1.2.0`) - - SwiftLint (= 0.23.1) + - SwiftLint (= 0.25.0) - Weakify (from `https://github.com/klundberg/Weakify.git`, tag `v0.4.0`) +SPEC REPOS: + https://github.com/CocoaPods/Specs.git: + - SwiftLint + EXTERNAL SOURCES: Nimble: :git: https://github.com/Quick/Nimble.git - :tag: v7.0.2 + :tag: v7.0.3 Quick: :git: https://github.com/Quick/Quick.git :tag: v1.2.0 @@ -24,7 +28,7 @@ EXTERNAL SOURCES: CHECKOUT OPTIONS: Nimble: :git: https://github.com/Quick/Nimble.git - :tag: v7.0.2 + :tag: v7.0.3 Quick: :git: https://github.com/Quick/Quick.git :tag: v1.2.0 @@ -33,11 +37,11 @@ CHECKOUT OPTIONS: :tag: v0.4.0 SPEC CHECKSUMS: - Nimble: 5c3b8c4b0229d95c2c7b0005e2edf244937dbb04 + Nimble: 6254fec7d02791c7dc33722d799f2a951dd147c1 Quick: 65081c7ab6eb85f9b65dbecbaf88793ce9ce47bc - SwiftLint: 1b670ce79284c76520f84060e87d645078fd32fa + SwiftLint: e14651157288e9e01d6e1a71db7014fb5744a8ea Weakify: 77be86c462237baa373e97fcf57d4d8637c2e614 -PODFILE CHECKSUM: 460e2597e90a61f53f0a95f1905dbfe2a8d3855a +PODFILE CHECKSUM: fa1f4284dde0db4aed641478f32ec2467b1e15d4 -COCOAPODS: 1.4.0 +COCOAPODS: 1.5.0 diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 031a0690..e8b88c66 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -446,7 +446,6 @@ B51F219F1F417037009BC2C9 /* Frameworks */, B51F21A01F417037009BC2C9 /* Resources */, C57ED08E45623928E1F82168 /* [CP] Embed Pods Frameworks */, - D080B9179C49F538425D9877 /* [CP] Copy Pods Resources */, B51F21CE1F41F32D009BC2C9 /* Embed Frameworks */, ); buildRules = ( @@ -505,7 +504,6 @@ B5334F1B1B8CC5BD00C64A6D /* Frameworks */, B5334F1C1B8CC5BD00C64A6D /* Resources */, 7BD682369F694709705F5C93 /* [CP] Embed Pods Frameworks */, - 6AE0A3E3587C9FF47D0E5997 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -609,21 +607,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 6AE0A3E3587C9FF47D0E5997 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-QuickTableViewController-iOSTests/Pods-QuickTableViewController-iOSTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; 7BD682369F694709705F5C93 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -708,21 +691,6 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example-iOS/Pods-Example-iOS-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - D080B9179C49F538425D9877 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Example-iOS/Pods-Example-iOS-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; D6A5837800B2AEA91500816C /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; From 36dc9de5e0f493549ab84d77c8a16cd1a7ef01fb Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 5 Apr 2018 15:11:57 +0800 Subject: [PATCH 23/23] Use SwiftLint via the podspec --- Podfile | 2 +- Podfile.lock | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Podfile b/Podfile index 561b63b1..0a9b8a8d 100644 --- a/Podfile +++ b/Podfile @@ -10,6 +10,6 @@ target "QuickTableViewController-iOSTests" do end target "Example-iOS" do - pod "SwiftLint", "0.25.0" + pod "SwiftLint", podspec: "https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/4/0/1/SwiftLint/0.25.0/SwiftLint.podspec.json" pod "Weakify", git: "https://github.com/klundberg/Weakify.git", tag: "v0.4.0" end diff --git a/Podfile.lock b/Podfile.lock index fec0b00c..cb13e444 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -7,13 +7,9 @@ PODS: DEPENDENCIES: - Nimble (from `https://github.com/Quick/Nimble.git`, tag `v7.0.3`) - Quick (from `https://github.com/Quick/Quick.git`, tag `v1.2.0`) - - SwiftLint (= 0.25.0) + - SwiftLint (from `https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/4/0/1/SwiftLint/0.25.0/SwiftLint.podspec.json`) - Weakify (from `https://github.com/klundberg/Weakify.git`, tag `v0.4.0`) -SPEC REPOS: - https://github.com/CocoaPods/Specs.git: - - SwiftLint - EXTERNAL SOURCES: Nimble: :git: https://github.com/Quick/Nimble.git @@ -21,6 +17,8 @@ EXTERNAL SOURCES: Quick: :git: https://github.com/Quick/Quick.git :tag: v1.2.0 + SwiftLint: + :podspec: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/4/0/1/SwiftLint/0.25.0/SwiftLint.podspec.json Weakify: :git: https://github.com/klundberg/Weakify.git :tag: v0.4.0 @@ -42,6 +40,6 @@ SPEC CHECKSUMS: SwiftLint: e14651157288e9e01d6e1a71db7014fb5744a8ea Weakify: 77be86c462237baa373e97fcf57d4d8637c2e614 -PODFILE CHECKSUM: fa1f4284dde0db4aed641478f32ec2467b1e15d4 +PODFILE CHECKSUM: 9fcd2a1e3af645ede9b21d5cbdc536a26bee3280 COCOAPODS: 1.5.0