Skip to content

Commit b70fedf

Browse files
committed
Update for Swift 4 and @objc inference
1 parent 6e7b095 commit b70fedf

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

KeyCommand/KeyCommand.xcodeproj/project.pbxproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@
197197
5334D0761DD3B6250032CB00 = {
198198
CreatedOnToolsVersion = 8.1;
199199
DevelopmentTeam = LCC2J94N44;
200+
LastSwiftMigration = 0900;
200201
ProvisioningStyle = Automatic;
201202
};
202203
};
@@ -450,7 +451,8 @@
450451
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
451452
PRODUCT_BUNDLE_IDENTIFIER = com.useyourloaf.KeyCommand;
452453
PRODUCT_NAME = "$(TARGET_NAME)";
453-
SWIFT_VERSION = 3.0;
454+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
455+
SWIFT_VERSION = 4.0;
454456
};
455457
name = Debug;
456458
};
@@ -463,7 +465,8 @@
463465
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
464466
PRODUCT_BUNDLE_IDENTIFIER = com.useyourloaf.KeyCommand;
465467
PRODUCT_NAME = "$(TARGET_NAME)";
466-
SWIFT_VERSION = 3.0;
468+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
469+
SWIFT_VERSION = 4.0;
467470
};
468471
name = Release;
469472
};

KeyCommand/KeyCommand/OptionViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ class OptionViewController: UIViewController {
6363
]
6464
}
6565

66-
func performCommand(sender: UIKeyCommand) {
67-
guard let key = InputKey(rawValue: sender.input) else {
66+
@objc func performCommand(sender: UIKeyCommand) {
67+
guard let key = InputKey(rawValue: sender.input!) else {
6868
return
6969
}
7070
switch key {

KeyCommand/KeyCommand/SegueHandlerType.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ extension SegueHandlerType where Self: UIViewController, SegueIdentifier.RawValu
4545
func segueIdentifierForSegue(segue: UIStoryboardSegue) -> SegueIdentifier {
4646
guard let identifier = segue.identifier,
4747
let segueIdentifier = SegueIdentifier(rawValue: identifier) else {
48-
fatalError("Unknown Segue Identifier \(segue.identifier)")
48+
fatalError("Unknown Segue Identifier \(segue.identifier ?? "Missing")")
4949
}
5050
return segueIdentifier
5151
}

0 commit comments

Comments
 (0)