Skip to content

Commit af9d6b2

Browse files
committed
Changes to Examples project to support Swift 4.2
1 parent 1aab931 commit af9d6b2

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

Examples/MotionExamples.xcodeproj/project.pbxproj

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
isa = PBXProject;
230230
attributes = {
231231
LastSwiftUpdateCheck = 0730;
232-
LastUpgradeCheck = 0900;
232+
LastUpgradeCheck = 1000;
233233
ORGANIZATIONNAME = "Poet & Mountain, LLC";
234234
TargetAttributes = {
235235
8BB379D31CFFA17D00A35AFD = {
@@ -342,12 +342,14 @@
342342
CLANG_WARN_BOOL_CONVERSION = YES;
343343
CLANG_WARN_COMMA = YES;
344344
CLANG_WARN_CONSTANT_CONVERSION = YES;
345+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
345346
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
346347
CLANG_WARN_EMPTY_BODY = YES;
347348
CLANG_WARN_ENUM_CONVERSION = YES;
348349
CLANG_WARN_INFINITE_RECURSION = YES;
349350
CLANG_WARN_INT_CONVERSION = YES;
350351
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
352+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
351353
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
352354
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
353355
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -381,7 +383,7 @@
381383
SDKROOT = iphoneos;
382384
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
383385
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
384-
SWIFT_VERSION = 4.0;
386+
SWIFT_VERSION = 4.2;
385387
};
386388
name = Debug;
387389
};
@@ -398,12 +400,14 @@
398400
CLANG_WARN_BOOL_CONVERSION = YES;
399401
CLANG_WARN_COMMA = YES;
400402
CLANG_WARN_CONSTANT_CONVERSION = YES;
403+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
401404
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
402405
CLANG_WARN_EMPTY_BODY = YES;
403406
CLANG_WARN_ENUM_CONVERSION = YES;
404407
CLANG_WARN_INFINITE_RECURSION = YES;
405408
CLANG_WARN_INT_CONVERSION = YES;
406409
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
410+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
407411
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
408412
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
409413
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
@@ -429,7 +433,7 @@
429433
SDKROOT = iphoneos;
430434
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
431435
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
432-
SWIFT_VERSION = 4.0;
436+
SWIFT_VERSION = 4.2;
433437
VALIDATE_PRODUCT = YES;
434438
};
435439
name = Release;
@@ -443,7 +447,7 @@
443447
PRODUCT_BUNDLE_IDENTIFIER = com.poetmountain.MotionExamples;
444448
PRODUCT_NAME = "$(TARGET_NAME)";
445449
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
446-
SWIFT_VERSION = 4.0;
450+
SWIFT_VERSION = 4.2;
447451
};
448452
name = Debug;
449453
};
@@ -456,7 +460,7 @@
456460
PRODUCT_BUNDLE_IDENTIFIER = com.poetmountain.MotionExamples;
457461
PRODUCT_NAME = "$(TARGET_NAME)";
458462
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
459-
SWIFT_VERSION = 4.0;
463+
SWIFT_VERSION = 4.2;
460464
};
461465
name = Release;
462466
};

Examples/MotionExamples/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1313

1414
var window: UIWindow?
1515

16-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
16+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
1717
window = UIWindow.init(frame: UIScreen.main.bounds)
1818

1919
let master_vc = MasterViewController.init()
2020
let nav = UINavigationController.init()
21-
nav.addChildViewController(master_vc)
21+
nav.addChild(master_vc)
2222
window?.rootViewController = nav
2323

2424
window?.makeKeyAndVisible()

Examples/MotionExamples/ButtonsView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,22 @@ public class ButtonsView: UIView {
4545
private func setupUI() {
4646

4747
startButton = UIButton.init(type: .system)
48-
startButton.setTitle("Start", for: UIControlState())
48+
startButton.setTitle("Start", for: UIControl.State())
4949
startButton.addTarget(self, action: #selector(start), for: .touchUpInside)
5050
self.addSubview(startButton)
5151

5252
stopButton = UIButton.init(type: .system)
53-
stopButton.setTitle("Stop", for: UIControlState())
53+
stopButton.setTitle("Stop", for: UIControl.State())
5454
stopButton.addTarget(self, action: #selector(stop), for: .touchUpInside)
5555
self.addSubview(stopButton)
5656

5757
pauseButton = UIButton.init(type: .system)
58-
pauseButton.setTitle("Pause", for: UIControlState())
58+
pauseButton.setTitle("Pause", for: UIControl.State())
5959
pauseButton.addTarget(self, action: #selector(pause), for: .touchUpInside)
6060
self.addSubview(pauseButton)
6161

6262
resumeButton = UIButton.init(type: .system)
63-
resumeButton.setTitle("Resume", for: UIControlState())
63+
resumeButton.setTitle("Resume", for: UIControl.State())
6464
resumeButton.addTarget(self, action: #selector(resume), for: .touchUpInside)
6565
self.addSubview(resumeButton)
6666

Examples/MotionExamples/Classes/AdditiveViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public class AdditiveViewController: UIViewController, ButtonsViewDelegate {
211211

212212
@objc func viewTappedHandler(_ gesture: UITapGestureRecognizer) {
213213

214-
if (gesture.state != UIGestureRecognizerState.ended) {
214+
if (gesture.state != UIGestureRecognizer.State.ended) {
215215
return;
216216
}
217217

Examples/MotionExamples/Classes/DynamicViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public class DynamicViewController: UIViewController, ButtonsViewDelegate {
138138

139139
@objc func viewTappedHandler(_ gesture: UITapGestureRecognizer) {
140140

141-
if (gesture.state != UIGestureRecognizerState.ended) {
141+
if (gesture.state != UIGestureRecognizer.State.ended) {
142142
return;
143143
}
144144

0 commit comments

Comments
 (0)