Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ disabled_rules:
- force_cast
- function_body_length
- identifier_name
- line_length
- vertical_whitespace
opt_in_rules:
- closure_end_indentation
Expand Down Expand Up @@ -36,4 +37,3 @@ included:
excluded:
- Carthage
- Pods
line_length: 192
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
language: objective-c
osx_image: xcode9.3beta
matrix:
include:
- env: VERSION=latest
osx_image: xcode10
cache:
- bundler
- cocoapods
before_install:
- export LANG=en_US.UTF-8
- xcrun instruments -s devices
- open -b com.apple.iphonesimulator
- open -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
install:
- bundle install --without development --deployment --jobs=3 --retry=3
- bundle exec pod install
before_script:
- if [ -n "$DANGER_GITHUB_API_TOKEN" ]; then bundle exec danger; fi
script:
- set -o pipefail
- xcodebuild clean build -workspace QuickTableViewController.xcworkspace -scheme QuickTableViewController-iOS -sdk iphonesimulator SWIFT_VERSION=3.0 | bundle exec xcpretty -c
- bundle exec rake "test:ios[QuickTableViewController-iOS]"
- bundle exec rake "test:tvos[QuickTableViewController-tvOS]"
- bash <(curl -s https://codecov.io/bash) -cF ios -J "QuickTableViewController"
Expand Down
2 changes: 1 addition & 1 deletion Example-iOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal final class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? = nil) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
Comment thread
getaaron marked this conversation as resolved.

if #available(iOS 9.0, *) {
// See AppearanceViewController for the setups.
Expand Down
2 changes: 1 addition & 1 deletion Example-tvOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Comment thread
getaaron marked this conversation as resolved.
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = UINavigationController(rootViewController: TableViewController())
window?.makeKeyAndVisible()
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ GEM
ffi (>= 0.5.0, < 2)
redcarpet (3.4.0)
rouge (2.0.7)
ruby-macho (1.2.0)
ruby-macho (1.3.0)
sass (3.5.7)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
Expand Down
2 changes: 1 addition & 1 deletion QuickTableViewController.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pod::Spec.new do |s|
s.license = { type: "MIT", file: "LICENSE" }
s.author = "bcylin"

s.swift_version = "4.0"
s.swift_version = "4.2"
s.ios.deployment_target = "8.0"
s.tvos.deployment_target = "9.0"

Expand Down
34 changes: 15 additions & 19 deletions QuickTableViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -703,25 +703,26 @@
TargetAttributes = {
B51F21A11F417037009BC2C9 = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
ProvisioningStyle = Manual;
};
B51F21BF1F41E600009BC2C9 = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
ProvisioningStyle = Manual;
TestTargetID = B51F21A11F417037009BC2C9;
};
B5334F121B8CC5BD00C64A6D = {
CreatedOnToolsVersion = 6.4;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
};
B5334F1D1B8CC5BD00C64A6D = {
CreatedOnToolsVersion = 6.4;
LastSwiftMigration = 0930;
};
B54A24252088816D00EEBA26 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
B54A242D2088816E00EEBA26 = {
Expand All @@ -730,6 +731,7 @@
};
B54A24522088D44A00EEBA26 = {
CreatedOnToolsVersion = 9.3;
LastSwiftMigration = 1000;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -1160,8 +1162,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1182,8 +1183,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -1206,8 +1206,7 @@
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_TARGET_NAME = "Example-iOS";
};
name = Debug;
Expand All @@ -1230,8 +1229,7 @@
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TEST_TARGET_NAME = "Example-iOS";
};
name = Release;
Expand Down Expand Up @@ -1375,8 +1373,7 @@
PRODUCT_NAME = QuickTableViewController;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -1397,8 +1394,7 @@
PRODUCT_NAME = QuickTableViewController;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down Expand Up @@ -1468,7 +1464,7 @@
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand Down Expand Up @@ -1498,7 +1494,7 @@
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand Down Expand Up @@ -1576,7 +1572,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand All @@ -1602,7 +1598,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand Down
2 changes: 1 addition & 1 deletion Source/Model/Section.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ open class Section {
// MARK: - Properties

/// The text of the section title.
open let title: String?
public let title: String?

/// The array of rows in the section.
open var rows: [Row & RowStyle]
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/Subtitle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public enum Subtitle: Equatable {
case leftAligned(String)

/// Returns the corresponding table view cell style.
public var style: UITableViewCellStyle {
public var style: UITableViewCell.CellStyle {
switch self {
case .none: return .default
case .belowTitle: return .subtitle
Expand Down Expand Up @@ -79,7 +79,7 @@ public enum Subtitle: Equatable {
}


internal extension UITableViewCellStyle {
internal extension UITableViewCell.CellStyle {

var stringValue: String {
switch self {
Expand Down
4 changes: 2 additions & 2 deletions Source/Protocol/RowStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ public protocol RowStyle {
var cellReuseIdentifier: String { get }

/// The style of the table view cell to display the row.
var cellStyle: UITableViewCellStyle { get }
var cellStyle: UITableViewCell.CellStyle { get }

/// The icon of the row.
var icon: Icon? { get }

/// The type of standard accessory view the cell should use.
var accessoryType: UITableViewCellAccessoryType { get }
var accessoryType: UITableViewCell.AccessoryType { get }

/// The flag that indicates whether the table view cell should trigger the action when selected.
var isSelectable: Bool { get }
Expand Down
4 changes: 2 additions & 2 deletions Source/QuickTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ open class QuickTableViewController: UIViewController, UITableViewDataSource, UI

- returns: An initialized `QuickTableViewController` object.
*/
public convenience init(style: UITableViewStyle) {
public convenience init(style: UITableView.Style) {
self.init(nibName: nil, bundle: nil)
tableView = UITableView(frame: .zero, style: style)
}
Expand All @@ -68,7 +68,7 @@ open class QuickTableViewController: UIViewController, UITableViewDataSource, UI
view.addSubview(tableView)
tableView.frame = view.bounds
tableView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
tableView.rowHeight = UITableViewAutomaticDimension
tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight = 44
tableView.dataSource = self
tableView.delegate = self
Expand Down
4 changes: 2 additions & 2 deletions Source/Rows/NavigationRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ open class NavigationRow<T: UITableViewCell>: NavigationRowCompatible, Equatable
}

/// Returns the table view cell style for the specified subtitle.
public var cellStyle: UITableViewCellStyle {
public var cellStyle: UITableViewCell.CellStyle {
return subtitle?.style ?? .default
}

/// The icon of the row.
public let icon: Icon?

/// Returns `.disclosureIndicator` when action is not nil, otherwise returns `.none`.
public var accessoryType: UITableViewCellAccessoryType {
public var accessoryType: UITableViewCell.AccessoryType {
return (action == nil) ? .none : .disclosureIndicator
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Rows/OptionRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ open class OptionRow<T: UITableViewCell>: OptionRowCompatible, Equatable {
public let cellReuseIdentifier: String = T.reuseIdentifier

/// The cell style is `.default`.
public let cellStyle: UITableViewCellStyle = .default
public let cellStyle: UITableViewCell.CellStyle = .default

/// The icon of the row.
public let icon: Icon?

/// Returns `.checkmark` when the row is selected, otherwise returns `.none`.
public var accessoryType: UITableViewCellAccessoryType {
public var accessoryType: UITableViewCell.AccessoryType {
return isSelected ? .checkmark : .none
}

Expand Down
6 changes: 3 additions & 3 deletions Source/Rows/SwitchRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,23 @@ open class SwitchRow<T: SwitchCell>: SwitchRowCompatible, Equatable {
public let cellReuseIdentifier: String = T.reuseIdentifier

/// The cell style is `.default`.
public let cellStyle: UITableViewCellStyle = .default
public let cellStyle: UITableViewCell.CellStyle = .default

/// The icon of the row.
public let icon: Icon?

#if os(iOS)

/// The default accessory type is `.none`.
public let accessoryType: UITableViewCellAccessoryType = .none
public let accessoryType: UITableViewCell.AccessoryType = .none

/// The `SwitchRow` should not be selectable.
public let isSelectable: Bool = false

#elseif os(tvOS)

/// Returns `.checkmark` when the `switchValue` is on, otherwise returns `.none`.
public var accessoryType: UITableViewCellAccessoryType {
public var accessoryType: UITableViewCell.AccessoryType {
return switchValue ? .checkmark : .none
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Rows/TapActionRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ open class TapActionRow<T: TapActionCell>: TapActionRowCompatible, Equatable {
public let cellReuseIdentifier: String = T.reuseIdentifier

/// The cell style is `.default`.
public let cellStyle: UITableViewCellStyle = .default
public let cellStyle: UITableViewCell.CellStyle = .default

/// The default icon is nil.
public let icon: Icon? = nil

/// The default accessory type is `.none`.
public let accessoryType: UITableViewCellAccessoryType = .none
public let accessoryType: UITableViewCell.AccessoryType = .none

/// The `TapActionRow` is selectable when action is not nil.
public var isSelectable: Bool {
Expand Down
2 changes: 1 addition & 1 deletion Source/Views/SwitchCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ open class SwitchCell: UITableViewCell, Configurable {

- returns: An initialized `SwitchCell` object.
*/
public override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setUpAppearance()
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Views/TapActionCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ open class TapActionCell: UITableViewCell {

- returns: An initialized `TapActionCell` object.
*/
public override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: .default, reuseIdentifier: reuseIdentifier)
setUpAppearance()
}
Expand Down