diff --git a/.codecov.yml b/.codecov.yml index 3dd5c688..f1bf7b2d 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -5,7 +5,7 @@ coverage: default: target: 90% comment: - layout: "diff, files" + layout: "files" ignore: - "Carthage/**/*" - "Example*/**/*" diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..eeec8d93 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: bcylin diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 00000000..e0813af7 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,19 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 14 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - discussion + - help wanted + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: invalid +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false diff --git a/.github/workflows/run_tests.yml b/.github/workflows/ci.yml similarity index 63% rename from .github/workflows/run_tests.yml rename to .github/workflows/ci.yml index 5d0d33cd..fe17b49d 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/ci.yml @@ -1,33 +1,45 @@ -name: Tests +name: CI on: [push, pull_request] jobs: run-tests: name: Run tests runs-on: macOS-latest + if: contains(github.event.head_commit.message, '[ci skip]') == false + env: + BUNDLE_PATH: vendor/bundle + POD_PATH: Pods steps: - uses: actions/checkout@master - - uses: actions/setup-ruby@v1 + - uses: actions/setup-ruby@v1.1.2 with: ruby-version: '2.6.x' - - uses: actions/cache@v1 + + # Cache + - name: Cache ${{ env.BUNDLE_PATH }} + uses: actions/cache@v2.1.1 with: - path: vendor/bundle + path: ${{ env.BUNDLE_PATH }} key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} restore-keys: ${{ runner.os }}-gems- - - uses: actions/cache@v1 + - name: Cache ${{ env.POD_PATH }} + uses: actions/cache@v2.1.1 with: - path: Pods + path: ${{ env.POD_PATH }} key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} restore-keys: ${{ runner.os }}-pods- + + # Dependencies - name: Bundle install run: | - gem install bundler:2.1.4 - bundle config path vendor/bundle + gem install bundler -v `tail -1 Gemfile.lock` + bundle config path ${{ env.BUNDLE_PATH }} bundle install --jobs 4 --retry 3 - name: Pod install run: | bundle exec pod install + + # Tests - run: | bundle exec fastlane ios unit_tests - run: | diff --git a/.gitignore b/.gitignore index 2c449885..2c84c49a 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ Pods/ ## Carthage Carthage/ + +## Swift Package tests +Package.xcodeproj diff --git a/.jazzy.yml b/.jazzy.yml index dc487baa..59b241d5 100644 --- a/.jazzy.yml +++ b/.jazzy.yml @@ -2,14 +2,14 @@ clean: true author: bcylin author_url: https://github.com/bcylin github_url: https://github.com/bcylin/QuickTableViewController -github_file_prefix: https://github.com/bcylin/QuickTableViewController/blob/v1.2.4 +github_file_prefix: https://github.com/bcylin/QuickTableViewController/blob/v1.3.0 xcodebuild_arguments: [ -project, QuickTableViewController.xcodeproj, -scheme, QuickTableViewController-iOS, -sdk, iphonesimulator ] module: QuickTableViewController -module_version: 1.2.4 +module_version: 1.3.0 output: docs/output theme: fullwidth skip_undocumented: true diff --git a/.travis.yml b/.travis.yml index a9f4a1b7..8cc25c6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,21 @@ language: objective-c osx_image: xcode11.3 cache: - - bundler + directories: + - vendor/bundle + - vendor/mint before_install: - export LANG=en_US.UTF-8 - xcrun instruments -s devices install: + - bundle config path vendor/bundle - bundle install --without development --deployment --jobs=3 --retry=3 + - brew list mint > /dev/null || brew install mint + - mint bootstrap script: - set -e + - mint run yonaskolb/XcodeGen xcodegen generate --project Package --spec Package/Package.yml + - bundler exec fastlane swift_package - make -B carthage - make -B docs after_success: diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b92b730..6132e681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Change Log +## v1.3.0 + +* Use SF Symbols as icon images, [#41](https://github.com/bcylin/QuickTableViewController/pull/41) by [@ezfe](https://github.com/ezfe) +* Make `init(style:)` a designated initializer +* Add an option to override table view for style configuration, [#74](https://github.com/bcylin/QuickTableViewController/pull/74) by [@Tobisaninfo](https://github.com/Tobisaninfo) +* Set IPHONEOS_DEPLOYMENT_TARGET to 9.0 + ## v1.2.4 * Fix an issue where the same identifier is used for different cell types [#50](https://github.com/bcylin/QuickTableViewController/issues/50) diff --git a/Example-iOS/Info.plist b/Example-iOS/Info.plist index 9977ac5e..83407e04 100644 --- a/Example-iOS/Info.plist +++ b/Example-iOS/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.2.4 + 1.3.0 CFBundleVersion 101 LSRequiresIPhoneOS diff --git a/Example-iOS/ViewControllers/AppearanceViewController.swift b/Example-iOS/ViewControllers/AppearanceViewController.swift index 5881db4b..5430388d 100644 --- a/Example-iOS/ViewControllers/AppearanceViewController.swift +++ b/Example-iOS/ViewControllers/AppearanceViewController.swift @@ -29,6 +29,20 @@ import QuickTableViewController internal final class AppearanceViewController: QuickTableViewController { + init() { + if #available(iOS 13.0, *) { + super.init(style: .insetGrouped) + } else { + super.init(style: .grouped) + } + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - UIViewController + override func viewDidLoad() { super.viewDidLoad() title = "UIAppearance" diff --git a/Example-iOS/ViewControllers/CustomizationViewController.swift b/Example-iOS/ViewControllers/CustomizationViewController.swift index f70bdd11..5b930d9e 100644 --- a/Example-iOS/ViewControllers/CustomizationViewController.swift +++ b/Example-iOS/ViewControllers/CustomizationViewController.swift @@ -39,6 +39,20 @@ private final class CustomOptionRow: OptionRow {} internal final class CustomizationViewController: QuickTableViewController { + init() { + if #available(iOS 13.0, *) { + super.init(style: .insetGrouped) + } else { + super.init(style: .grouped) + } + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - Properties + private let debugging = Section( title: nil, rows: [NavigationRow(text: "", detailText: .none)], diff --git a/Example-iOS/ViewControllers/ExampleViewController.swift b/Example-iOS/ViewControllers/ExampleViewController.swift index 1d3115ec..30b71233 100644 --- a/Example-iOS/ViewControllers/ExampleViewController.swift +++ b/Example-iOS/ViewControllers/ExampleViewController.swift @@ -29,6 +29,18 @@ import QuickTableViewController internal final class ExampleViewController: QuickTableViewController { + init() { + if #available(iOS 13.0, *) { + super.init(style: .insetGrouped) + } else { + super.init(style: .grouped) + } + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + // MARK: - Properties private let debugging = Section(title: nil, rows: [NavigationRow(text: "", detailText: .none)]) diff --git a/Example-iOS/ViewControllers/RootViewController.swift b/Example-iOS/ViewControllers/RootViewController.swift index a2a138aa..7298c189 100644 --- a/Example-iOS/ViewControllers/RootViewController.swift +++ b/Example-iOS/ViewControllers/RootViewController.swift @@ -29,14 +29,28 @@ import QuickTableViewController internal final class RootViewController: QuickTableViewController { - override func viewDidLoad() { - super.viewDidLoad() + init() { + if #available(iOS 13.0, *) { + super.init(style: .insetGrouped) + } else { + super.init(style: .grouped) + } let titleLabel = UILabel() titleLabel.text = "QuickTableViewController" titleLabel.font = UIFont.boldSystemFont(ofSize: 17) title = " " navigationItem.titleView = titleLabel + } + + required init?(coder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + + // MARK: - UIViewController + + override func viewDidLoad() { + super.viewDidLoad() tableContents = [ Section(title: "Default", rows: [ diff --git a/Example-iOSUITests/Info.plist b/Example-iOSUITests/Info.plist index b797526d..d8685c76 100644 --- a/Example-iOSUITests/Info.plist +++ b/Example-iOSUITests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.2.4 + 1.3.0 CFBundleVersion 1 diff --git a/Example-tvOS/Info.plist b/Example-tvOS/Info.plist index 592164fd..e601b109 100644 --- a/Example-tvOS/Info.plist +++ b/Example-tvOS/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.2.4 + 1.3.0 CFBundleVersion 101 LSRequiresIPhoneOS diff --git a/Example-tvOSUITests/Info.plist b/Example-tvOSUITests/Info.plist index 1d45cf79..351fdedd 100644 --- a/Example-tvOSUITests/Info.plist +++ b/Example-tvOSUITests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.2.4 + 1.3.0 CFBundleVersion 1 diff --git a/Gemfile.lock b/Gemfile.lock index 76a33f65..5d5ebf9f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,32 +9,32 @@ GEM tzinfo (~> 1.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - algoliasearch (1.27.2) + algoliasearch (1.27.3) httpclient (~> 2.8, >= 2.8.3) json (>= 1.5.1) atomos (0.1.3) aws-eventstream (1.1.0) - aws-partitions (1.320.0) - aws-sdk-core (3.96.1) + aws-partitions (1.379.0) + aws-sdk-core (3.109.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.239.0) aws-sigv4 (~> 1.1) jmespath (~> 1.0) - aws-sdk-kms (1.31.0) - aws-sdk-core (~> 3, >= 3.71.0) + aws-sdk-kms (1.39.0) + aws-sdk-core (~> 3, >= 3.109.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.66.0) - aws-sdk-core (~> 3, >= 3.96.1) + aws-sdk-s3 (1.82.0) + aws-sdk-core (~> 3, >= 3.109.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.1) - aws-sigv4 (1.1.3) - aws-eventstream (~> 1.0, >= 1.0.2) + aws-sigv4 (1.2.2) + aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.3) claide (1.0.3) - cocoapods (1.9.2) + cocoapods (1.9.3) activesupport (>= 4.0.2, < 5) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.9.2) + cocoapods-core (= 1.9.3) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.2.2, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -50,7 +50,7 @@ GEM nap (~> 1.0) ruby-macho (~> 1.4) xcodeproj (>= 1.14.0, < 2.0) - cocoapods-core (1.9.2) + cocoapods-core (1.9.3) activesupport (>= 4.0.2, < 6) algoliasearch (~> 1.0) concurrent-ruby (~> 1.1) @@ -73,52 +73,51 @@ GEM commander-fastlane (4.4.6) highline (~> 1.7.2) concurrent-ruby (1.1.6) - declarative (0.0.10) + declarative (0.0.20) declarative-option (0.1.0) - digest-crc (0.5.1) + digest-crc (0.6.1) + rake (~> 13.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.5) - emoji_regex (1.0.1) + dotenv (2.7.6) + emoji_regex (3.0.0) escape (0.0.4) ethon (0.12.0) ffi (>= 1.3.0) - excon (0.73.0) + excon (0.76.0) faraday (1.0.1) multipart-post (>= 1.2, < 3) - faraday-cookie_jar (0.0.6) - faraday (>= 0.7.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) http-cookie (~> 1.0.0) faraday_middleware (1.0.0) faraday (~> 1.0) - fastimage (2.1.7) - fastlane (2.148.1) + fastimage (2.2.0) + fastlane (2.162.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.3, < 3.0.0) aws-sdk-s3 (~> 1.0) - babosa (>= 1.0.2, < 2.0.0) + babosa (>= 1.0.3, < 2.0.0) bundler (>= 1.12.0, < 3.0.0) colored commander-fastlane (>= 4.4.6, < 5.0.0) dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (>= 0.1, < 2.0) + emoji_regex (>= 0.1, < 4.0) excon (>= 0.71.0, < 1.0.0) - faraday (>= 0.17, < 2.0) + faraday (~> 1.0) faraday-cookie_jar (~> 0.0.6) - faraday_middleware (>= 0.13.1, < 2.0) + faraday_middleware (~> 1.0) fastimage (>= 2.1.0, < 3.0.0) gh_inspector (>= 1.1.2, < 2.0.0) google-api-client (>= 0.37.0, < 0.39.0) google-cloud-storage (>= 1.15.0, < 2.0.0) highline (>= 1.7.2, < 2.0.0) json (< 3.0.0) - jwt (~> 2.1.0) + jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) - multi_xml (~> 0.5) multipart-post (~> 2.0.0) plist (>= 3.1.0, < 4.0.0) - public_suffix (~> 2.0.0) - rubyzip (>= 1.3.0, < 2.0.0) + rubyzip (>= 2.0.0, < 3.0.0) security (= 0.1.3) simctl (~> 1.6.3) slack-notifier (>= 2.0.0, < 3.0.0) @@ -130,7 +129,7 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - ffi (1.12.2) + ffi (1.13.1) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) @@ -145,17 +144,17 @@ GEM google-cloud-core (1.5.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) - google-cloud-env (1.3.1) + google-cloud-env (1.3.3) faraday (>= 0.17.3, < 2.0) - google-cloud-errors (1.0.0) - google-cloud-storage (1.26.1) + google-cloud-errors (1.0.1) + google-cloud-storage (1.29.0) addressable (~> 2.5) digest-crc (~> 0.4) google-api-client (~> 0.33) google-cloud-core (~> 1.2) googleauth (~> 0.9) mini_mime (~> 1.0) - googleauth (0.12.0) + googleauth (0.13.1) faraday (>= 0.17.3, < 2.0) jwt (>= 1.4, < 3.0) memoist (~> 0.16) @@ -168,7 +167,7 @@ GEM httpclient (2.8.3) i18n (0.9.5) concurrent-ruby (~> 1.0) - jazzy (0.13.3) + jazzy (0.13.5) cocoapods (~> 1.5) mustache (~> 1.1) open4 @@ -178,26 +177,26 @@ GEM sqlite3 (~> 1.3) xcinvoke (~> 0.3.0) jmespath (1.4.0) - json (2.3.0) - jwt (2.1.0) + json (2.3.1) + jwt (2.2.2) liferaft (0.0.6) memoist (0.16.2) mini_magick (4.10.1) mini_mime (1.0.2) minitest (5.14.1) molinillo (0.6.6) - multi_json (1.14.1) - multi_xml (0.6.0) + multi_json (1.15.0) multipart-post (2.0.0) mustache (1.1.1) - nanaimo (0.2.6) + nanaimo (0.3.0) nap (1.1.0) naturally (2.2.0) netrc (0.11.0) open4 (1.3.4) - os (1.1.0) + os (1.1.1) plist (3.5.0) - public_suffix (2.0.5) + public_suffix (4.0.6) + rake (13.0.1) redcarpet (3.5.0) representable (3.0.4) declarative (< 0.1.0) @@ -206,8 +205,8 @@ GEM retriable (3.1.2) rouge (2.0.7) ruby-macho (1.4.0) - rubyzip (1.3.0) - sassc (2.3.0) + rubyzip (2.3.0) + sassc (2.4.0) ffi (~> 1.9) security (0.1.3) signet (0.14.0) @@ -225,7 +224,7 @@ GEM unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) tty-cursor (0.7.1) - tty-screen (0.7.1) + tty-screen (0.8.1) tty-spinner (0.9.3) tty-cursor (~> 0.7) typhoeus (1.4.0) @@ -240,12 +239,12 @@ GEM word_wrap (1.0.0) xcinvoke (0.3.0) liferaft (~> 0.0.6) - xcodeproj (1.16.0) + xcodeproj (1.18.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) colored2 (~> 3.1) - nanaimo (~> 0.2.6) + nanaimo (~> 0.3.0) xcpretty (0.3.0) rouge (~> 2.0.7) xcpretty-travis-formatter (1.0.0) diff --git a/Makefile b/Makefile index 7463ff75..aa913c5e 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,11 @@ ci-test: unit-test ui-test make -B carthage make -B docs +swift-package-project: + rm -rf Package/Package.xcproj + mint run yonaskolb/XcodeGen xcodegen generate --project Package --spec Package/Package.yml + open Package/Package.xcodeproj + bump: ifeq (,$(strip $(version))) # Usage: make bump version= diff --git a/Mintfile b/Mintfile new file mode 100644 index 00000000..f3162c55 --- /dev/null +++ b/Mintfile @@ -0,0 +1 @@ +yonaskolb/XcodeGen@2.18.0 diff --git a/Package/Package.yml b/Package/Package.yml new file mode 100644 index 00000000..db06c7a4 --- /dev/null +++ b/Package/Package.yml @@ -0,0 +1,18 @@ +name: Package +packages: + QuickTableViewController: + path: ../ +options: + deploymentTarget: + iOS: "13.0" +targets: + App: + type: application + platform: iOS + sources: Package + settings: + base: + INFOPLIST_FILE: Package/Info.plist + PRODUCT_BUNDLE_IDENTIFIER: "io.github.bcylin.QuickTableViewController.Package" + dependencies: + - package: QuickTableViewController diff --git a/Package/Package/AppDelegate.swift b/Package/Package/AppDelegate.swift new file mode 100644 index 00000000..60300afd --- /dev/null +++ b/Package/Package/AppDelegate.swift @@ -0,0 +1,25 @@ +// +// AppDelegate.swift +// Package +// +// Created by Ben on 03/10/2020. +// Copyright © 2020 bcylin. All rights reserved. +// + +import UIKit +import QuickTableViewController + +@UIApplicationMain +final class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + window = UIWindow(frame: UIScreen.main.bounds) + window?.backgroundColor = UIColor.white + window?.rootViewController = UINavigationController(rootViewController: QuickTableViewController()) + window?.makeKeyAndVisible() + return true + } + +} diff --git a/Package/Package/Base.lproj/LaunchScreen.storyboard b/Package/Package/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 00000000..865e9329 --- /dev/null +++ b/Package/Package/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Package/Package/Info.plist b/Package/Package/Info.plist new file mode 100644 index 00000000..108ad6cd --- /dev/null +++ b/Package/Package/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Podfile b/Podfile index 1c74df93..4679026e 100644 --- a/Podfile +++ b/Podfile @@ -4,7 +4,7 @@ inhibit_all_warnings! workspace "QuickTableViewController" project "QuickTableViewController" -target "Example-iOS" do - platform :ios, "8.0" +target "Dependencies" do + platform :ios, "9.0" pod "SwiftLint" end diff --git a/Podfile.lock b/Podfile.lock index 5928c881..01c54490 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,5 +1,5 @@ PODS: - - SwiftLint (0.39.2) + - SwiftLint (0.40.3) DEPENDENCIES: - SwiftLint @@ -9,8 +9,8 @@ SPEC REPOS: - SwiftLint SPEC CHECKSUMS: - SwiftLint: 22ccbbe3b8008684be5955693bab135e0ed6a447 + SwiftLint: dfd554ff0dff17288ee574814ccdd5cea85d76f7 -PODFILE CHECKSUM: fe34e199a00b296003d05d1e9a6471da2c319a8a +PODFILE CHECKSUM: b3ddd4e98ee56e9087046650bf3ab0fe9255aef7 -COCOAPODS: 1.9.2 +COCOAPODS: 1.9.3 diff --git a/QuickTableViewController.podspec b/QuickTableViewController.podspec index 397d3386..b445779b 100644 --- a/QuickTableViewController.podspec +++ b/QuickTableViewController.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "QuickTableViewController" - s.version = "1.2.4" + s.version = "1.3.0" s.summary = "A simple way to create a UITableView for settings." s.screenshots = "https://raw.githubusercontent.com/bcylin/QuickTableViewController/gh-pages/img/screenshot-1.png", "https://raw.githubusercontent.com/bcylin/QuickTableViewController/gh-pages/img/screenshot-2.png" diff --git a/QuickTableViewController.xcodeproj/project.pbxproj b/QuickTableViewController.xcodeproj/project.pbxproj index 6bc15d56..23572243 100644 --- a/QuickTableViewController.xcodeproj/project.pbxproj +++ b/QuickTableViewController.xcodeproj/project.pbxproj @@ -17,6 +17,7 @@ 3E45598221DC134800FC0C76 /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E45598121DC134800FC0C76 /* Deprecated.swift */; }; 3E45598421DC181600FC0C76 /* DetailText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E45597921DA81B100FC0C76 /* DetailText.swift */; }; 3E45598521DC184800FC0C76 /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E45598121DC134800FC0C76 /* Deprecated.swift */; }; + 556D2EA250E858D32C46C861 /* libPods-Dependencies.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F8655D4AB80B4936AC42CA96 /* libPods-Dependencies.a */; }; B50E73851F2E1BC900481910 /* RowStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50E73841F2E1BC900481910 /* RowStyle.swift */; }; B51F21A51F417037009BC2C9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F21A41F417037009BC2C9 /* AppDelegate.swift */; }; B51F21A71F417037009BC2C9 /* ExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51F21A61F417037009BC2C9 /* ExampleViewController.swift */; }; @@ -100,7 +101,6 @@ B5F0FFEA1E9CC6F9007BF1C9 /* SwitchRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F0FFE91E9CC6F9007BF1C9 /* SwitchRow.swift */; }; B5F0FFEC1E9CC72D007BF1C9 /* TapActionRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F0FFEB1E9CC72D007BF1C9 /* TapActionRow.swift */; }; B5F0FFEE1E9CC73D007BF1C9 /* Subtitle.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5F0FFED1E9CC73D007BF1C9 /* Subtitle.swift */; }; - D170E867128089544B16CE99 /* libPods-Example-iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6620CD4D16DD2CE0756D2F0A /* libPods-Example-iOS.a */; }; F6B15A5623F74268001DB252 /* DynamicTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6B15A5523F74268001DB252 /* DynamicTableViewController.swift */; }; /* End PBXBuildFile section */ @@ -175,14 +175,15 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 06B02F4C1455A204E247A3A4 /* Pods-Dependencies.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Dependencies.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Dependencies/Pods-Dependencies.debug.xcconfig"; sourceTree = ""; }; 136DD2FD216A367B00F554F0 /* Example-tvOSUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Example-tvOSUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 136DD2FF216A367B00F554F0 /* ExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleUITests.swift; sourceTree = ""; }; 136DD301216A367B00F554F0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 2465BE3F49A19EA359F14487 /* Pods-Dependencies.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Dependencies.release.xcconfig"; path = "Pods/Target Support Files/Pods-Dependencies/Pods-Dependencies.release.xcconfig"; sourceTree = ""; }; 3E45597921DA81B100FC0C76 /* DetailText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailText.swift; sourceTree = ""; }; 3E45597D21DA8B3400FC0C76 /* DetailTextTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailTextTests.swift; sourceTree = ""; }; 3E45598121DC134800FC0C76 /* Deprecated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Deprecated.swift; sourceTree = ""; }; - 6620CD4D16DD2CE0756D2F0A /* libPods-Example-iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Example-iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - AB273CBF0D8B2FE21DADE7C9 /* 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 = ""; }; + B508BF56252BA01600319CF9 /* Dependencies.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Dependencies.app; sourceTree = BUILT_PRODUCTS_DIR; }; B50E73841F2E1BC900481910 /* RowStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RowStyle.swift; sourceTree = ""; }; 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 = ""; }; @@ -247,9 +248,9 @@ B5F0FFE91E9CC6F9007BF1C9 /* SwitchRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwitchRow.swift; sourceTree = ""; }; B5F0FFEB1E9CC72D007BF1C9 /* TapActionRow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TapActionRow.swift; sourceTree = ""; }; B5F0FFED1E9CC73D007BF1C9 /* Subtitle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Subtitle.swift; sourceTree = ""; }; - F38FAF46C17E44E24E353EA4 /* 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 = ""; }; F6B15A5323F73E48001DB252 /* DynamicTableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DynamicTableView.swift; sourceTree = ""; }; F6B15A5523F74268001DB252 /* DynamicTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DynamicTableViewController.swift; sourceTree = ""; }; + F8655D4AB80B4936AC42CA96 /* libPods-Dependencies.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Dependencies.a"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -260,11 +261,18 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B508BF53252BA01600319CF9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 556D2EA250E858D32C46C861 /* libPods-Dependencies.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; B51F219F1F417037009BC2C9 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D170E867128089544B16CE99 /* libPods-Example-iOS.a in Frameworks */, B51F21CC1F41F32C009BC2C9 /* QuickTableViewController.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -327,8 +335,8 @@ 8C6CEEE3B0A0A83B161533E0 /* Pods */ = { isa = PBXGroup; children = ( - F38FAF46C17E44E24E353EA4 /* Pods-Example-iOS.debug.xcconfig */, - AB273CBF0D8B2FE21DADE7C9 /* Pods-Example-iOS.release.xcconfig */, + 06B02F4C1455A204E247A3A4 /* Pods-Dependencies.debug.xcconfig */, + 2465BE3F49A19EA359F14487 /* Pods-Dependencies.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -466,6 +474,7 @@ B5334F141B8CC5BD00C64A6D /* Products */ = { isa = PBXGroup; children = ( + B508BF56252BA01600319CF9 /* Dependencies.app */, B51F21A21F417037009BC2C9 /* Example-iOS.app */, B51F21C01F41E600009BC2C9 /* Example-iOSUITests.xctest */, B54A24532088D44A00EEBA26 /* Example-tvOS.app */, @@ -563,7 +572,7 @@ DC2649918C33230B7E02933D /* Frameworks */ = { isa = PBXGroup; children = ( - 6620CD4D16DD2CE0756D2F0A /* libPods-Example-iOS.a */, + F8655D4AB80B4936AC42CA96 /* libPods-Dependencies.a */, ); name = Frameworks; sourceTree = ""; @@ -608,11 +617,28 @@ productReference = 136DD2FD216A367B00F554F0 /* Example-tvOSUITests.xctest */; productType = "com.apple.product-type.bundle.ui-testing"; }; + B508BF55252BA01600319CF9 /* Dependencies */ = { + isa = PBXNativeTarget; + buildConfigurationList = B508BF69252BA01900319CF9 /* Build configuration list for PBXNativeTarget "Dependencies" */; + buildPhases = ( + 37D42B2AB2A2688C53A6D4C5 /* [CP] Check Pods Manifest.lock */, + B508BF52252BA01600319CF9 /* Sources */, + B508BF53252BA01600319CF9 /* Frameworks */, + B508BF54252BA01600319CF9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Dependencies; + productName = Dependencies; + productReference = B508BF56252BA01600319CF9 /* Dependencies.app */; + productType = "com.apple.product-type.application"; + }; B51F21A11F417037009BC2C9 /* Example-iOS */ = { isa = PBXNativeTarget; buildConfigurationList = B51F21B31F417037009BC2C9 /* Build configuration list for PBXNativeTarget "Example-iOS" */; buildPhases = ( - 4A6FB9F6C2BF30014F64565C /* [CP] Check Pods Manifest.lock */, B51F21BB1F417269009BC2C9 /* SwiftLint */, B51F219E1F417037009BC2C9 /* Sources */, B51F219F1F417037009BC2C9 /* Frameworks */, @@ -747,7 +773,7 @@ B5334F0A1B8CC5BD00C64A6D /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1000; + LastSwiftUpdateCheck = 1200; LastUpgradeCheck = 1020; ORGANIZATIONNAME = bcylin; TargetAttributes = { @@ -757,6 +783,10 @@ ProvisioningStyle = Manual; TestTargetID = B54A24522088D44A00EEBA26; }; + B508BF55252BA01600319CF9 = { + CreatedOnToolsVersion = 12.0; + ProvisioningStyle = Automatic; + }; B51F21A11F417037009BC2C9 = { CreatedOnToolsVersion = 8.3.3; LastSwiftMigration = 1020; @@ -814,6 +844,7 @@ B51F21BF1F41E600009BC2C9 /* Example-iOSUITests */, B54A24522088D44A00EEBA26 /* Example-tvOS */, 136DD2FC216A367B00F554F0 /* Example-tvOSUITests */, + B508BF55252BA01600319CF9 /* Dependencies */, ); }; /* End PBXProject section */ @@ -826,6 +857,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B508BF54252BA01600319CF9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; B51F21A01F417037009BC2C9 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -889,7 +927,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 4A6FB9F6C2BF30014F64565C /* [CP] Check Pods Manifest.lock */ = { + 37D42B2AB2A2688C53A6D4C5 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -904,7 +942,7 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Example-iOS-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-Dependencies-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -982,6 +1020,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + B508BF52252BA01600319CF9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; B51F219E1F417037009BC2C9 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -1179,7 +1224,6 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; TEST_TARGET_NAME = "Example-tvOS"; - TVOS_DEPLOYMENT_TARGET = 12.0; }; name = Debug; }; @@ -1206,13 +1250,69 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; TEST_TARGET_NAME = "Example-tvOS"; - TVOS_DEPLOYMENT_TARGET = 12.0; + }; + name = Release; + }; + B508BF67252BA01900319CF9 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 06B02F4C1455A204E247A3A4 /* Pods-Dependencies.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_ASSET_PATHS = ""; + ENABLE_PREVIEWS = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = ""; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController.Dependencies; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + B508BF68252BA01900319CF9 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2465BE3F49A19EA359F14487 /* Pods-Dependencies.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_ASSET_PATHS = ""; + ENABLE_PREVIEWS = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + INFOPLIST_FILE = ""; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController.Dependencies; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; B51F21B11F417037009BC2C9 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F38FAF46C17E44E24E353EA4 /* Pods-Example-iOS.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -1222,7 +1322,6 @@ DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "Example-iOS/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController.Example; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1234,7 +1333,6 @@ }; B51F21B21F417037009BC2C9 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AB273CBF0D8B2FE21DADE7C9 /* Pods-Example-iOS.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -1243,7 +1341,6 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "Example-iOS/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = io.github.bcylin.QuickTableViewController.Example; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1352,7 +1449,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -1360,6 +1457,7 @@ SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; + TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -1410,12 +1508,13 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.2; TARGETED_DEVICE_FAMILY = "1,2"; + TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1581,7 +1680,6 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 11.3; }; name = Debug; }; @@ -1605,7 +1703,6 @@ SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 11.3; }; name = Release; }; @@ -1674,6 +1771,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + B508BF69252BA01900319CF9 /* Build configuration list for PBXNativeTarget "Dependencies" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + B508BF67252BA01900319CF9 /* Debug */, + B508BF68252BA01900319CF9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; B51F21B31F417037009BC2C9 /* Build configuration list for PBXNativeTarget "Example-iOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme index 50c99bcd..0cf20f50 100644 --- a/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme +++ b/QuickTableViewController.xcodeproj/xcshareddata/xcschemes/Example-iOS.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -39,17 +48,6 @@ - - - - - - - - + + + + @@ -39,17 +48,6 @@ - - - - - - - - + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> + + + + @@ -54,17 +63,6 @@ - - - - - - - - + + + + @@ -39,17 +48,6 @@ - - - - - - - - CFBundlePackageType FMWK CFBundleShortVersionString - 1.2.4 + 1.3.0 CFBundleSignature ???? CFBundleVersion diff --git a/QuickTableViewController/Info-iOSTests.plist b/QuickTableViewController/Info-iOSTests.plist index 2243b9d4..3fee538d 100644 --- a/QuickTableViewController/Info-iOSTests.plist +++ b/QuickTableViewController/Info-iOSTests.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.2.4 + 1.3.0 CFBundleSignature ???? CFBundleVersion diff --git a/QuickTableViewController/Info-tvOS.plist b/QuickTableViewController/Info-tvOS.plist index a6b0794f..3c2f9a0c 100644 --- a/QuickTableViewController/Info-tvOS.plist +++ b/QuickTableViewController/Info-tvOS.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.2.4 + 1.3.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/QuickTableViewController/Info-tvOSTests.plist b/QuickTableViewController/Info-tvOSTests.plist index 1d45cf79..351fdedd 100644 --- a/QuickTableViewController/Info-tvOSTests.plist +++ b/QuickTableViewController/Info-tvOSTests.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.2.4 + 1.3.0 CFBundleVersion 1 diff --git a/README.md b/README.md index 1f3e19e7..151a06cb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # QuickTableViewController -[![GitHub Actions](https://github.com/bcylin/QuickTableViewController/workflows/Tests/badge.svg)](https://github.com/bcylin/QuickTableViewController/actions) +[![GitHub Actions](https://github.com/bcylin/QuickTableViewController/workflows/CI/badge.svg)](https://github.com/bcylin/QuickTableViewController/actions) [![Codecov](https://img.shields.io/codecov/c/github/bcylin/QuickTableViewController)](https://codecov.io/gh/bcylin/QuickTableViewController) [![Carthage compatible](https://img.shields.io/badge/carthage-compatible-green.svg)](https://github.com/Carthage/Carthage) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/QuickTableViewController.svg)](https://cocoapods.org/pods/QuickTableViewController) @@ -252,6 +252,7 @@ QuickTableViewController | iOS | tvOS | Xcode | Swift `~> 1.0.0` | 8.0+ | 9.0+ | 9.4 | 4.1 `~> 1.1.0` | 8.0+ | 9.0+ | 10.1 | 4.2 `~> 1.2.0` | 8.0+ | 9.0+ | 10.2 | 5.0 +`~> 1.3.0` | 9.0+ | 9.0+ | 12.0 | 5.3 ## Installation diff --git a/Source/Model/Icon.swift b/Source/Model/Icon.swift index 7691c87f..d8fa2611 100644 --- a/Source/Model/Icon.swift +++ b/Source/Model/Icon.swift @@ -27,38 +27,71 @@ import UIKit /// A struct that represents the image used in a row. -public enum Icon: Equatable { +public struct Icon: Equatable { - /// 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 initializer is kept private until v2.0 when `methodSignature` is removed. + private init(methodSignature: String, image: UIImage?, highlightedImage: UIImage?) { + self.methodSignature = methodSignature + self.image = image + self.highlightedImage = highlightedImage + } + + // MARK: - Properties + + /// A string to keep track of how the struct is initialized. + /// It's used internally to avoid the breaking Equatable changes of Icon (as enum) until v2.0. + private let methodSignature: String /// The image for the normal state. - public var image: UIImage? { - switch self { - case let .named(name): - return UIImage(named: name) - case let .image(image): - return image - case let .images(normal: image, highlighted: _): - return image - } - } + public let image: UIImage? /// The image for the highlighted state. - public var highlightedImage: UIImage? { - switch self { - case let .named(name): - return UIImage(named: name + "-highlighted") - case .image: - return nil - case let .images(normal: _, highlighted: image): - return image - } + public let highlightedImage: UIImage? + + // MARK: - + + /// Returns `Icon` with an image of the given name for the normal state. + /// The "-highlighted" suffix is appended to the name for the highlighted image. + /// + /// - Parameters: + /// - name: The name of the image asset. + /// - bundle: The bundle containing the image file or asset catalog. Specify nil to search the app’s main bundle. + /// - traitCollection: The traits associated with the intended environment for the image. Specify nil to use the traits associated with the main screen. + public static func named(_ name: String, in bundle: Bundle? = nil, compatibleWith traitCollection: UITraitCollection? = nil) -> Self { + return Icon( + methodSignature: "\(#function):\(name)", + image: UIImage(named: name, in: bundle, compatibleWith: traitCollection), + highlightedImage: UIImage(named: name + "-highlighted", in: bundle, compatibleWith: traitCollection) + ) + } + + /// Returns `Icon` with an image for the normal state. The image for the highlighted state is nil. + /// A method to provide backward compatiblility with the previous enum `case image(UIImage)`. + public static func image(_ image: UIImage) -> Self { + return Icon(methodSignature: #function, image: image, highlightedImage: nil) + } + + /// Returns `Icon` with images for the normal and highlighted states. + /// A method to provide backward compatiblility with the previous enum `case images(normal: UIImage, highlighted: UIImage)`. + public static func images(normal: UIImage, highlighted: UIImage) -> Self { + return Icon(methodSignature: #function, image: normal, highlightedImage: highlighted) + } + + /// Returns `Icon` with the specified SF Symbol as the image for the normal state. + /// The image for the highlighted state is nil. + /// + /// - Parameters: + /// - name: The name of the system symbol image. + /// - configuration: The configuration to specify traits and other details that define the variant of image. + @available(iOS 13.0, tvOS 13.0, *) + public static func sfSymbol(_ name: String, withConfiguration configuration: UIImage.Configuration? = nil) -> Self { + // Make sure the image scales with the Dynamic Type settings. + let fallback = UIImage.SymbolConfiguration(textStyle: .body) + return Icon( + methodSignature: "\(#function):\(name)", + image: UIImage(systemName: name, withConfiguration: configuration ?? fallback), + highlightedImage: nil + ) } } diff --git a/Source/QuickTableViewController.swift b/Source/QuickTableViewController.swift index 0d081a03..70dca1f9 100644 --- a/Source/QuickTableViewController.swift +++ b/Source/QuickTableViewController.swift @@ -33,7 +33,7 @@ open class QuickTableViewController: UIViewController, UITableViewDataSource, UI open var clearsSelectionOnViewWillAppear = true /// Returns the table view managed by the controller object. - open private(set) var tableView: UITableView = UITableView(frame: .zero, style: .grouped) + open var tableView: UITableView = UITableView(frame: .zero, style: .grouped) /// The layout of sections and rows to display in the table view. open var tableContents: [Section] = [] { @@ -44,16 +44,28 @@ open class QuickTableViewController: UIViewController, UITableViewDataSource, UI // MARK: - Initialization - /** - Initializes a table view controller to manage a table view of a given style. + /// Initializes a table view controller to manage a table view of a given style. + /// + /// - Parameter style: A constant that specifies the style of table view that the controller object is to manage. + public init(style: UITableView.Style) { + super.init(nibName: nil, bundle: nil) + tableView = UITableView(frame: .zero, style: style) + } - - parameter style: A constant that specifies the style of table view that the controller object is to manage (`.plain` or `.grouped`). + /// Returns a newly initialized view controller with the nib file in the specified bundle. + /// + /// - Parameters: + /// - nibNameOrNil: The name of the nib file to associate with the view controller. + /// - nibBundleOrNil: The bundle in which to search for the nib file. + public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { + super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) + } - - returns: An initialized `QuickTableViewController` object. - */ - public convenience init(style: UITableView.Style) { - self.init(nibName: nil, bundle: nil) - tableView = UITableView(frame: .zero, style: style) + /// Returns an object initialized from data in a given unarchiver. + /// + /// - Parameter coder: An unarchiver object. + public required init?(coder: NSCoder) { + super.init(coder: coder) } deinit { diff --git a/Tests/Model/IconTests.swift b/Tests/Model/IconTests.swift index 85bb571f..d3410306 100644 --- a/Tests/Model/IconTests.swift +++ b/Tests/Model/IconTests.swift @@ -29,25 +29,101 @@ import XCTest internal final class IconTests: XCTestCase { - private let image = UIImage(named: "icon", in: Bundle(for: IconTests.self), compatibleWith: nil)! - private let highlighted = UIImage(named: "icon-highlighted", in: Bundle(for: IconTests.self), compatibleWith: nil)! + private func testImageNamed(_ name: String) -> UIImage { + return UIImage(named: name, in: Bundle(for: IconTests.self), compatibleWith: nil)! + } // MARK: - Initialization - func testInitialiation() { + func testInitialiation_withName() { + // When + let icon: Icon = .named("icon", in: Bundle(for: IconTests.self)) + + // Then + XCTAssertEqual(icon.image, testImageNamed("icon")) + XCTAssertEqual(icon.highlightedImage, testImageNamed("icon-highlighted")) + } + + func testInitialiation_withNameNotFound() { + // When + let icon: Icon = .named("not-found", in: Bundle(for: IconTests.self)) + + // Then + XCTAssertNil(icon.image) + XCTAssertNil(icon.highlightedImage) + } + + func testInitialiation_withImage() { // Given - let image = self.image + let image = testImageNamed("icon") // When - let icon = Icon.image(image) + let icon: Icon = .image(image) // Then XCTAssertEqual(icon.image, image) XCTAssertNil(icon.highlightedImage) } + func testInitialiation_withImages() { + // Given + let imageA = testImageNamed("icon") + let imageB = testImageNamed("icon-highlighted") + + // When + let icon: Icon = .images(normal: imageA, highlighted: imageB) + + // Then + XCTAssertEqual(icon.image, imageA) + XCTAssertEqual(icon.highlightedImage, imageB) + } + + // MARK: - SFSymbols + + @available(iOS 13.0, tvOS 13.0, *) + func testSFSymbol() { + // Given + let name = "gear" + + // When + let icon: Icon = .sfSymbol(name) + + // Then + let expectedImage = UIImage(systemName: name, withConfiguration: UIImage.SymbolConfiguration(textStyle: .body)) + XCTAssertEqual(icon.image, expectedImage) + XCTAssertNil(icon.highlightedImage) + } + + @available(iOS 13.0, tvOS 13.0, *) + func testSFSymbol_withConfiguration() { + // Given + let name = "camera" + let configuration = UIImage.SymbolConfiguration(scale: .large) + + // When + let icon: Icon = .sfSymbol(name, withConfiguration: configuration) + + // Then + let expectedImage = UIImage(systemName: name, withConfiguration: configuration) + XCTAssertEqual(icon.image, expectedImage) + XCTAssertNil(icon.highlightedImage) + } + + @available(iOS 13.0, tvOS 13.0, *) + func testSFSymbol_notFound() { + // When + let icon: Icon = .sfSymbol("not-found") + + // Then + XCTAssertNil(icon.image) + XCTAssertNil(icon.highlightedImage) + } + // MARK: - Equatable + private lazy var image = testImageNamed("icon") + private lazy var highlighted = testImageNamed("icon-highlighted") + func testEquatable_withIdenticalParameters() { // Given let one = Icon.image(image) @@ -113,4 +189,5 @@ internal final class IconTests: XCTestCase { // Then XCTAssert(one != another) } + } diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 2017bdc8..cc567874 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -7,6 +7,18 @@ config = { code_coverage: true } +desc "Test Swift Package" +lane :swift_package do + Dir.chdir("../Package") do + sh [ + %(set -o pipefail &&), + %(xcodebuild -resolvePackageDependencies &&), + %(xcodebuild -project Package.xcodeproj -scheme App -sdk iphonesimulator clean build), + %(| bundle exec xcpretty -c) + ].join " " + end +end + platform :ios do desc "Run iOS unit tests" lane :unit_tests do