Skip to content

Commit ec4d6ad

Browse files
author
Luc Dion
committed
Upgrade Sample app to Swift 4.2
1 parent 07e33d6 commit ec4d6ad

File tree

8 files changed

+17
-18
lines changed

8 files changed

+17
-18
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: objective-c
2-
osx_image: xcode9.4
2+
osx_image: xcode10
33

44
cache:
55
- bundler

Example/PinLayoutSample.xcodeproj/project.pbxproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@
510510
TargetAttributes = {
511511
249EFE3E1E64FAFE00165E39 = {
512512
CreatedOnToolsVersion = 8.2.1;
513+
LastSwiftMigration = 1000;
513514
ProvisioningStyle = Automatic;
514515
};
515516
};
@@ -844,7 +845,7 @@
844845
PRODUCT_NAME = "$(TARGET_NAME)";
845846
SWIFT_OBJC_BRIDGING_HEADER = "PinLayoutSample/UI/Examples/PinLayoutSample-Bridging-Header.h";
846847
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
847-
SWIFT_VERSION = 4.0;
848+
SWIFT_VERSION = 4.2;
848849
};
849850
name = Debug;
850851
};
@@ -861,7 +862,7 @@
861862
PRODUCT_BUNDLE_IDENTIFIER = com.layoutbox.PinLayoutSample;
862863
PRODUCT_NAME = "$(TARGET_NAME)";
863864
SWIFT_OBJC_BRIDGING_HEADER = "PinLayoutSample/UI/Examples/PinLayoutSample-Bridging-Header.h";
864-
SWIFT_VERSION = 4.0;
865+
SWIFT_VERSION = 4.2;
865866
};
866867
name = Release;
867868
};

Example/PinLayoutSample/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import PinLayout
2424
class AppDelegate: UIResponder, UIApplicationDelegate {
2525
var window: UIWindow?
2626

27-
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
27+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
2828

2929
window = UIWindow(frame: UIScreen.main.bounds)
3030
window!.backgroundColor = UIColor.white

Example/PinLayoutSample/UI/Common/BaseFormView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ class BaseFormView: UIView {
3232
formScrollView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(didTapScrollView)))
3333
addSubview(formScrollView)
3434

35-
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: .UIKeyboardWillShow, object: nil)
36-
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: .UIKeyboardWillHide, object: nil)
35+
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow), name: UIResponder.keyboardWillShowNotification, object: nil)
36+
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide), name: UIResponder.keyboardWillHideNotification, object: nil)
3737
}
3838

3939
required init(coder aDecoder: NSCoder) {
@@ -52,7 +52,7 @@ class BaseFormView: UIView {
5252

5353
@objc
5454
internal func keyboardWillShow(notification: Notification) {
55-
guard let sizeValue = notification.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue else { return }
55+
guard let sizeValue = notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue else { return }
5656
setFormScrollView(bottomInset: sizeValue.cgRectValue.height)
5757
}
5858

Example/PinLayoutSample/UI/Examples/TableViewExample/Cells/MethodCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class MethodCell: UITableViewCell {
2828
private let descriptionLabel = UILabel()
2929
private let padding: CGFloat = 10
3030

31-
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
31+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
3232
super.init(style: style, reuseIdentifier: reuseIdentifier)
3333

3434
selectionStyle = .none

Example/PinLayoutSample/UI/Examples/TableViewExample/TableViewExampleView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ extension TableViewExampleView: UITableViewDataSource, UITableViewDelegate {
8181
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
8282
// The UITableView will call the cell's sizeThatFit() method to compute the height.
8383
// WANRING: You must also set the UITableView.estimatedRowHeight for this to work.
84-
return UITableViewAutomaticDimension
84+
return UITableView.automaticDimension
8585
}
8686
}

Example/PinLayoutSample/UI/Examples/TableViewReadableContent/Cells/MethodReadableInsetsCell.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class MethodReadableInsetsCell: UITableViewCell {
88
private let descriptionLabel = UILabel()
99
private let margin: CGFloat = 10
1010

11-
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
11+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
1212
super.init(style: style, reuseIdentifier: reuseIdentifier)
1313

1414
selectionStyle = .none

PinLayout.xcodeproj/project.pbxproj

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -653,13 +653,13 @@
653653
};
654654
249EFE791E64FB4C00165E39 = {
655655
CreatedOnToolsVersion = 8.2.1;
656-
LastSwiftMigration = 0940;
656+
LastSwiftMigration = 1000;
657657
ProvisioningStyle = Automatic;
658658
};
659659
249EFE821E64FB4C00165E39 = {
660660
CreatedOnToolsVersion = 8.2.1;
661661
DevelopmentTeam = 4Q596JWQC5;
662-
LastSwiftMigration = 0920;
662+
LastSwiftMigration = 1000;
663663
ProvisioningStyle = Automatic;
664664
};
665665
DF1A5D1C2084C94700725EF5 = {
@@ -1246,7 +1246,7 @@
12461246
PRODUCT_NAME = PinLayout;
12471247
SKIP_INSTALL = YES;
12481248
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1249-
SWIFT_VERSION = 4.0;
1249+
SWIFT_VERSION = 4.2;
12501250
};
12511251
name = Debug;
12521252
};
@@ -1266,7 +1266,7 @@
12661266
PRODUCT_BUNDLE_IDENTIFIER = "com.mirego.PinLayout-iOS";
12671267
PRODUCT_NAME = PinLayout;
12681268
SKIP_INSTALL = YES;
1269-
SWIFT_VERSION = 4.0;
1269+
SWIFT_VERSION = 4.2;
12701270
};
12711271
name = Release;
12721272
};
@@ -1281,8 +1281,7 @@
12811281
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
12821282
PRODUCT_BUNDLE_IDENTIFIER = com.mirego.PinLayoutTests;
12831283
PRODUCT_NAME = "$(TARGET_NAME)";
1284-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
1285-
SWIFT_VERSION = 4.0;
1284+
SWIFT_VERSION = 4.2;
12861285
};
12871286
name = Debug;
12881287
};
@@ -1297,8 +1296,7 @@
12971296
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
12981297
PRODUCT_BUNDLE_IDENTIFIER = com.mirego.PinLayoutTests;
12991298
PRODUCT_NAME = "$(TARGET_NAME)";
1300-
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
1301-
SWIFT_VERSION = 4.0;
1299+
SWIFT_VERSION = 4.2;
13021300
};
13031301
name = Release;
13041302
};

0 commit comments

Comments
 (0)