Skip to content

Commit

Permalink
Migrate Sample Project to Swift 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Brager committed May 27, 2019
1 parent cfac587 commit 369e652
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Example-iOS/ViewControllers/ExampleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ internal final class ExampleViewController: QuickTableViewController {
private func showDebuggingText(_ text: String) {
print(text)
debugging.rows = [NavigationRow(text: text, detailText: .none)]
if let section = tableContents.index(where: { $0 === debugging }) {
if let section = tableContents.firstIndex(where: { $0 === debugging }) {
tableView.reloadSections([section], with: .none)
}
}
Expand Down
13 changes: 10 additions & 3 deletions QuickTableViewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -783,18 +783,18 @@
};
B51F21A11F417037009BC2C9 = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
B51F21BF1F41E600009BC2C9 = {
CreatedOnToolsVersion = 8.3.3;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
TestTargetID = B51F21A11F417037009BC2C9;
};
B5334F121B8CC5BD00C64A6D = {
CreatedOnToolsVersion = 6.4;
LastSwiftMigration = 1000;
LastSwiftMigration = 1020;
};
B5334F1D1B8CC5BD00C64A6D = {
CreatedOnToolsVersion = 6.4;
Expand All @@ -821,6 +821,7 @@
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -1363,6 +1364,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1383,6 +1385,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand All @@ -1405,6 +1408,7 @@
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
TEST_TARGET_NAME = "Example-iOS";
};
name = Debug;
Expand All @@ -1427,6 +1431,7 @@
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TEST_TARGET_NAME = "Example-iOS";
};
name = Release;
Expand Down Expand Up @@ -1567,6 +1572,7 @@
PRODUCT_NAME = QuickTableViewController;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -1586,6 +1592,7 @@
PRODUCT_NAME = QuickTableViewController;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
4 changes: 2 additions & 2 deletions Source/Model/RadioSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ open class RadioSection: Section {

/// Returns the selected index, or nil when nothing is selected.
open var indexOfSelectedOption: Int? {
return options.index { $0.isSelected }
return options.firstIndex { $0.isSelected }
}

/// Returns the selected option row, or nil when nothing is selected.
Expand Down Expand Up @@ -97,7 +97,7 @@ open class RadioSection: Section {

if option.isSelected {
// Deselect the selected option.
return options.index(where: { $0 === option }).map { [$0] } ?? []
return options.firstIndex(where: { $0 === option }).map { [$0] } ?? []
}

var toggledIndexes: IndexSet = []
Expand Down

0 comments on commit 369e652

Please sign in to comment.