Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit 1a5f86b

Browse files
nbadakhstaguer
authored andcommitted
Migrate swift version 4.0 to 4.1 (#223)
* Changes from flatmap to compactMap * Removed the weak applied protocol properties Changed LazyMapRandomAccessCollection to LazyMapCollection * Updated xcode project settings to 9.3 * Made travis use xcode9.3 image * Updated the swift version to 4.1 * Updated the swift version to 4.1 for: LayoutKit-iOS.xcodeproj/project.pbxproj LayoutKit-macOS.xcodeproj/project.pbxproj LayoutKit-tvOS.xcodeproj/project.pbxproj * Use the iphonesimulator11.3
1 parent d411b5d commit 1a5f86b

18 files changed

Lines changed: 42 additions & 49 deletions

File tree

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0
1+
4.1

.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
2+
osx_image: xcode9.3
33
script: sh build.sh /tmp/LayoutKit
44
after_success:
55
- bash <(curl -s https://codecov.io/bash) -D /tmp/LayoutKit

LayoutKit.xcodeproj/project.pbxproj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@
11511151
isa = PBXProject;
11521152
attributes = {
11531153
LastSwiftUpdateCheck = 0800;
1154-
LastUpgradeCheck = 0900;
1154+
LastUpgradeCheck = 0930;
11551155
TargetAttributes = {
11561156
0B2D09AF1D8735E1007E487C = {
11571157
CreatedOnToolsVersion = 8.0;
@@ -1781,11 +1781,13 @@
17811781
CLANG_WARN_BOOL_CONVERSION = YES;
17821782
CLANG_WARN_COMMA = YES;
17831783
CLANG_WARN_CONSTANT_CONVERSION = YES;
1784+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
17841785
CLANG_WARN_EMPTY_BODY = YES;
17851786
CLANG_WARN_ENUM_CONVERSION = YES;
17861787
CLANG_WARN_INFINITE_RECURSION = YES;
17871788
CLANG_WARN_INT_CONVERSION = YES;
17881789
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
1790+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
17891791
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
17901792
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
17911793
CLANG_WARN_STRICT_PROTOTYPES = YES;
@@ -1802,7 +1804,7 @@
18021804
GCC_WARN_UNUSED_FUNCTION = YES;
18031805
GCC_WARN_UNUSED_VARIABLE = YES;
18041806
ONLY_ACTIVE_ARCH = YES;
1805-
SWIFT_VERSION = 4.0;
1807+
SWIFT_VERSION = 4.1;
18061808
};
18071809
name = Debug;
18081810
};
@@ -1813,11 +1815,13 @@
18131815
CLANG_WARN_BOOL_CONVERSION = YES;
18141816
CLANG_WARN_COMMA = YES;
18151817
CLANG_WARN_CONSTANT_CONVERSION = YES;
1818+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
18161819
CLANG_WARN_EMPTY_BODY = YES;
18171820
CLANG_WARN_ENUM_CONVERSION = YES;
18181821
CLANG_WARN_INFINITE_RECURSION = YES;
18191822
CLANG_WARN_INT_CONVERSION = YES;
18201823
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
1824+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
18211825
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
18221826
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
18231827
CLANG_WARN_STRICT_PROTOTYPES = YES;
@@ -1832,7 +1836,8 @@
18321836
GCC_WARN_UNINITIALIZED_AUTOS = YES;
18331837
GCC_WARN_UNUSED_FUNCTION = YES;
18341838
GCC_WARN_UNUSED_VARIABLE = YES;
1835-
SWIFT_VERSION = 4.0;
1839+
SWIFT_COMPILATION_MODE = wholemodule;
1840+
SWIFT_VERSION = 4.1;
18361841
};
18371842
name = Release;
18381843
};

LayoutKit.xcodeproj/xcshareddata/xcschemes/ExampleLayouts-iOS.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
</Testables>
@@ -37,7 +36,6 @@
3736
buildConfiguration = "Debug"
3837
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
3938
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
40-
language = ""
4139
launchStyle = "0"
4240
useCustomWorkingDirectory = "NO"
4341
ignoresPersistentStateOnLaunch = "NO"

LayoutKit.xcodeproj/xcshareddata/xcschemes/LayoutKit-iOS.xcscheme

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,9 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
30-
shouldUseLaunchSchemeArgsEnv = "YES"
31-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
3332
<TestableReference
3433
skipped = "NO">
@@ -57,7 +56,6 @@
5756
buildConfiguration = "Debug"
5857
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5958
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60-
language = ""
6159
launchStyle = "0"
6260
useCustomWorkingDirectory = "NO"
6361
ignoresPersistentStateOnLaunch = "NO"

LayoutKit.xcodeproj/xcshareddata/xcschemes/LayoutKit-macOS.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

LayoutKit.xcodeproj/xcshareddata/xcschemes/LayoutKit-tvOS.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
<TestableReference
@@ -56,7 +55,6 @@
5655
buildConfiguration = "Debug"
5756
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5857
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
59-
language = ""
6058
launchStyle = "0"
6159
useCustomWorkingDirectory = "NO"
6260
ignoresPersistentStateOnLaunch = "NO"

LayoutKit.xcodeproj/xcshareddata/xcschemes/LayoutKitObjC-iOS.xcscheme

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,9 +26,8 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
30-
shouldUseLaunchSchemeArgsEnv = "YES"
31-
codeCoverageEnabled = "YES">
29+
codeCoverageEnabled = "YES"
30+
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
3332
<TestableReference
3433
skipped = "NO">
@@ -57,7 +56,6 @@
5756
buildConfiguration = "Debug"
5857
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5958
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
60-
language = ""
6159
launchStyle = "0"
6260
useCustomWorkingDirectory = "NO"
6361
ignoresPersistentStateOnLaunch = "NO"

LayoutKit.xcodeproj/xcshareddata/xcschemes/LayoutKitSampleApp.xcscheme

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0900"
3+
LastUpgradeVersion = "0930"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29-
language = ""
3029
shouldUseLaunchSchemeArgsEnv = "YES">
3130
<Testables>
3231
</Testables>
@@ -46,7 +45,6 @@
4645
buildConfiguration = "Debug"
4746
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4847
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
49-
language = ""
5048
launchStyle = "0"
5149
useCustomWorkingDirectory = "NO"
5250
ignoresPersistentStateOnLaunch = "NO"

LayoutKitSampleApp/NestedCollectionViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class NestedCollectionViewController: UIViewController {
5555
}
5656

5757
// Static to avoid capturing a reference to self
58-
private static func sectionLayout(sectionIndex: Int, count: Int) -> [Section<LazyMapRandomAccessCollection<CountableRange<Int>, Layout>>] {
58+
private static func sectionLayout(sectionIndex: Int, count: Int) -> [Section<LazyMapCollection<CountableRange<Int>, Layout>>] {
5959
let items = (0..<count).lazy.map { rowIndex -> Layout in
6060
let text = "\(sectionIndex)-\(rowIndex) " + String(repeating: "long word ", count: rowIndex)
6161
let urlText = text.replacingOccurrences(of: " ", with: "+")

0 commit comments

Comments
 (0)