Skip to content

Commit 2e76acd

Browse files
authored
Merge pull request #129 from layoutBox/upgrade_swift_4.2
Upgrade to Swift 4.2
2 parents 3c87ceb + 1f33690 commit 2e76acd

File tree

13 files changed

+29
-43
lines changed

13 files changed

+29
-43
lines changed

.travis.yml

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: objective-c
2-
osx_image: xcode9.3
2+
osx_image: xcode10.2
33

44
addons:
55
homebrew:
@@ -14,13 +14,10 @@ before_install:
1414
# - rvm use $RVM_RUBY_VERSION
1515
- bundle install
1616
- gem install xcpretty-travis-formatter;
17-
#- gem install cocoapods -v '1.3.1' --no-document --quiet;
18-
# - gem install slather --no-document --quiet;
1917
- bundle exec pod install --repo-update;
20-
# - carthage bootstrap --verbose --platform iOS --cache-builds --use-ssh
2118

2219
script:
23-
- buck test :yoga
20+
# - buck test :yoga
2421
- set -o pipefail && bundle exec fastlane travis
2522

2623
after_success:

Brewfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
tap 'facebook/fb'
2-
brew 'buck'
2+
brew 'buck'

Example/FlexLayoutSample.xcodeproj/project.pbxproj

+3-7
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@
373373
ORGANIZATIONNAME = Mirego;
374374
TargetAttributes = {
375375
DF1F2A051F17D11700BA1B97 = {
376-
LastSwiftMigration = 0930;
376+
LastSwiftMigration = 1010;
377377
};
378378
};
379379
};
@@ -436,13 +436,11 @@
436436
"${SRCROOT}/../Pods/Target Support Files/Pods-FlexLayoutSample/Pods-FlexLayoutSample-frameworks.sh",
437437
"${BUILT_PRODUCTS_DIR}/FlexLayout/FlexLayout.framework",
438438
"${BUILT_PRODUCTS_DIR}/PinLayout/PinLayout.framework",
439-
"${PODS_ROOT}/Reveal-SDK/RevealServer-10/iOS/RevealServer.framework",
440439
);
441440
name = "[CP] Embed Pods Frameworks";
442441
outputPaths = (
443442
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FlexLayout.framework",
444443
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PinLayout.framework",
445-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RevealServer.framework",
446444
);
447445
runOnlyForDeploymentPostprocessing = 0;
448446
shellPath = /bin/sh;
@@ -643,8 +641,7 @@
643641
INFOPLIST_FILE = "FlexLayoutSample/Supporting Files/Info.plist";
644642
PRODUCT_BUNDLE_IDENTIFIER = com.lucdion.FlexLayoutSample;
645643
PRODUCT_NAME = "$(TARGET_NAME)";
646-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
647-
SWIFT_VERSION = 4.0;
644+
SWIFT_VERSION = 4.2;
648645
};
649646
name = Debug;
650647
};
@@ -657,8 +654,7 @@
657654
INFOPLIST_FILE = "FlexLayoutSample/Supporting Files/Info.plist";
658655
PRODUCT_BUNDLE_IDENTIFIER = com.lucdion.FlexLayoutSample;
659656
PRODUCT_NAME = "$(TARGET_NAME)";
660-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
661-
SWIFT_VERSION = 4.0;
657+
SWIFT_VERSION = 4.2;
662658
};
663659
name = Release;
664660
};

Example/FlexLayoutSample/AppDelegate.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import UIKit
1818
class AppDelegate: UIResponder, UIApplicationDelegate {
1919
var window: UIWindow?
2020

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

2323
window = UIWindow(frame: UIScreen.main.bounds)
2424
window!.backgroundColor = UIColor.white

Example/FlexLayoutSample/UI/Examples/RaywenderlichTutorial/RaywenderlichTutorialView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class RayWenderlichTutorialView: UIView {
207207
let tabLabelFont = selected ? UIFont.boldSystemFont(ofSize: 14.0) : UIFont.systemFont(ofSize: 14.0)
208208

209209
#if swift(>=4)
210-
let labelSize = text.size(withAttributes: [NSAttributedStringKey.font: tabLabelFont])
210+
let labelSize = text.size(withAttributes: [NSAttributedString.Key.font: tabLabelFont])
211211
#else
212212
let labelSize = text.size(withAttributes: [NSAttributedStringKey.font: tabLabelFont])
213213
#endif

Example/FlexLayoutSample/UI/Examples/RaywenderlichTutorial/Subviews/ShowTableViewCell.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import UIKit
1616
class ShowTableViewCell: UITableViewCell {
1717
static var reuseIdentifier = "ShowTableViewCell"
1818

19-
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
19+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
2020
super.init(style: .subtitle, reuseIdentifier: reuseIdentifier)
2121

2222
self.textLabel?.textColor = .white

Example/FlexLayoutSample/UI/Examples/TableViewExample/Subviews/MethodCell.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class MethodCell: UITableViewCell {
2323
fileprivate let nameLabel = UILabel()
2424
fileprivate let descriptionLabel = UILabel()
2525

26-
override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
26+
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
2727
super.init(style: style, reuseIdentifier: reuseIdentifier)
2828

2929
selectionStyle = .none

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ extension TableViewExampleView: UITableViewDataSource, UITableViewDelegate {
7474
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
7575
// The UITableView will call the cell's sizeThatFit() method to compute the height.
7676
// WANRING: You must also set the UITableView.estimatedRowHeight for this to work.
77-
return UITableViewAutomaticDimension
77+
return UITableView.automaticDimension
7878
}
7979
}

FlexLayout.xcodeproj/project.pbxproj

+6-10
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,13 @@
330330
TargetAttributes = {
331331
24DA37591EF843C500D1AB2F = {
332332
CreatedOnToolsVersion = 8.3.2;
333-
LastSwiftMigration = 0930;
333+
LastSwiftMigration = 1010;
334334
ProvisioningStyle = Manual;
335335
};
336336
24DA37621EF843C500D1AB2F = {
337337
CreatedOnToolsVersion = 8.3.2;
338338
DevelopmentTeam = F37Y9H9E46;
339-
LastSwiftMigration = 0930;
339+
LastSwiftMigration = 1010;
340340
ProvisioningStyle = Automatic;
341341
};
342342
};
@@ -611,8 +611,7 @@
611611
SKIP_INSTALL = YES;
612612
SWIFT_OBJC_BRIDGING_HEADER = "";
613613
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
614-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
615-
SWIFT_VERSION = 4.0;
614+
SWIFT_VERSION = 4.2;
616615
};
617616
name = Debug;
618617
};
@@ -640,8 +639,7 @@
640639
PROVISIONING_PROFILE_SPECIFIER = "";
641640
SKIP_INSTALL = YES;
642641
SWIFT_OBJC_BRIDGING_HEADER = "";
643-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
644-
SWIFT_VERSION = 4.0;
642+
SWIFT_VERSION = 4.2;
645643
};
646644
name = Release;
647645
};
@@ -655,8 +653,7 @@
655653
OTHER_LDFLAGS = "$(inherited)";
656654
PRODUCT_BUNDLE_IDENTIFIER = com.lucdion.FlexLayoutTests;
657655
PRODUCT_NAME = "$(TARGET_NAME)";
658-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
659-
SWIFT_VERSION = 4.0;
656+
SWIFT_VERSION = 4.2;
660657
};
661658
name = Debug;
662659
};
@@ -670,8 +667,7 @@
670667
OTHER_LDFLAGS = "$(inherited)";
671668
PRODUCT_BUNDLE_IDENTIFIER = com.lucdion.FlexLayoutTests;
672669
PRODUCT_NAME = "$(TARGET_NAME)";
673-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
674-
SWIFT_VERSION = 4.0;
670+
SWIFT_VERSION = 4.2;
675671
};
676672
name = Release;
677673
};

FlexLayoutTests/RectNimbleMatcher.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ public func beCloseTo(_ expectedValue: CGRect, within delta: CGFloat = 0.000_01)
2424
let errorMessage = "be close to <\(stringify(expectedValue))> (each within \(stringify(delta)))"
2525
return Predicate.simple(errorMessage) { actualExpression in
2626
if let actual = try actualExpression.evaluate() {
27-
if fabs(actual.origin.x - expectedValue.origin.x) > delta {
27+
if abs(actual.origin.x - expectedValue.origin.x) > delta {
2828
return .doesNotMatch
2929
}
3030

31-
if fabs(actual.origin.y - expectedValue.origin.y) > delta {
31+
if abs(actual.origin.y - expectedValue.origin.y) > delta {
3232
return .doesNotMatch
3333
}
3434

35-
if fabs(actual.size.width - expectedValue.size.width) > delta {
35+
if abs(actual.size.width - expectedValue.size.width) > delta {
3636
return .doesNotMatch
3737
}
3838

39-
if fabs(actual.size.height - expectedValue.size.height) > delta {
39+
if abs(actual.size.height - expectedValue.size.height) > delta {
4040
return .doesNotMatch
4141
}
4242

Podfile

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ target 'FlexLayoutSample' do
1818
pod 'PinLayout'
1919

2020
# Debug only
21-
pod 'Reveal-SDK', '~> 10', :configurations => ['Debug']
2221
pod 'SwiftLint'
2322
end
2423

Podfile.lock

+3-7
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,20 @@ PODS:
33
- Nimble (8.0.1)
44
- PinLayout (1.8.7)
55
- Quick (2.1.0)
6-
- Reveal-SDK (10)
7-
- SwiftLint (0.32.0)
6+
- SwiftLint (0.33.0)
87

98
DEPENDENCIES:
109
- FlexLayout (from `./`)
1110
- Nimble
1211
- PinLayout
1312
- Quick
14-
- Reveal-SDK (~> 10)
1513
- SwiftLint
1614

1715
SPEC REPOS:
1816
https://github.com/cocoapods/specs.git:
1917
- Nimble
2018
- PinLayout
2119
- Quick
22-
- Reveal-SDK
2320
- SwiftLint
2421

2522
EXTERNAL SOURCES:
@@ -31,9 +28,8 @@ SPEC CHECKSUMS:
3128
Nimble: 45f786ae66faa9a709624227fae502db55a8bdd0
3229
PinLayout: a0722a5c8f0e0168a9c091ffe4930dabf0c8582c
3330
Quick: 4be43f6634acfa727dd106bdf3929ce125ffa79d
34-
Reveal-SDK: 7869ddf1f902cabbb07a1f0dd06bd25861a126f7
35-
SwiftLint: 009a898ef2a1c851f45e1b59349bf6ff2ddc990d
31+
SwiftLint: fed9c66336e41fc74dc48a73678380718f0c8b0e
3632

37-
PODFILE CHECKSUM: b49d5685f476a6600d008e69e030f9d4045be518
33+
PODFILE CHECKSUM: 9c74b444ce1d9b0b90a0d90a353efb1f26fd93e2
3834

3935
COCOAPODS: 1.5.3

fastlane/Fastfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ platform :ios do
4646
scheme: "FlexLayout",
4747
configuration: "Release",
4848
build: true,
49-
clean: true
49+
clean: true,
50+
destination: "platform=iOS Simulator,name=iPhone X,OS=12.2"
5051
)
5152

5253
#xcodebuild(
@@ -55,6 +56,7 @@ platform :ios do
5556
# configuration: "Release",
5657
# build: true,
5758
# clean: true
59+
# destination: "platform=iOS Simulator,name=iPhone X,OS=12.2"
5860
#)
5961

6062
xcodebuild(
@@ -63,7 +65,7 @@ platform :ios do
6365
configuration: "Release",
6466
build: true,
6567
clean: true,
66-
destination: "generic/platform=iOS\" CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY=\""
68+
destination: "platform=iOS Simulator,name=iPhone X,OS=12.2"
6769
)
6870
end
6971

@@ -80,7 +82,7 @@ platform :ios do
8082
lane :travis do
8183
build
8284
tests
83-
pod_lib_lint(allow_warnings: true, verbose: false)
85+
#pod_lib_lint(allow_warnings: true, verbose: false)
8486
end
8587

8688
lane :deploy do

0 commit comments

Comments
 (0)