Skip to content

Commit 7f69b85

Browse files
committed
Migration to Swift 4.2
1 parent b5e94e3 commit 7f69b85

File tree

9 files changed

+89
-75
lines changed

9 files changed

+89
-75
lines changed

.swift-version

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

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
os: osx
2-
osx_image: xcode9.2
2+
osx_image: xcode10.1
33
language: swift
44
before_install:
55
- pod repo update > /dev/null
66
script:
77
- set -o pipefail
8-
- xcodebuild test -workspace Vox.xcworkspace -scheme Vox -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.2' ONLY_ACTIVE_ARCH=NO
8+
- xcodebuild test -workspace Vox.xcworkspace -scheme Vox -destination 'platform=iOS Simulator,name=iPhone 8,OS=12.0' ONLY_ACTIVE_ARCH=NO
99
- pod lib lint
1010
after_success:
1111
- bash <(curl -s https://codecov.io/bash) -J 'Vox'

Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PODS:
2-
- Alamofire (4.7.0)
3-
- Nimble (7.0.3)
4-
- Quick (1.2.0)
2+
- Alamofire (4.8.0)
3+
- Nimble (7.3.1)
4+
- Quick (1.3.2)
55

66
DEPENDENCIES:
77
- Alamofire (~> 4.7)
@@ -15,9 +15,9 @@ SPEC REPOS:
1515
- Quick
1616

1717
SPEC CHECKSUMS:
18-
Alamofire: 907e0a98eb68cdb7f9d1f541a563d6ac5dc77b25
19-
Nimble: 7f5a9c447a33002645a071bddafbfb24ea70e0ac
20-
Quick: 58d203b1c5e27fff7229c4c1ae445ad7069a7a08
18+
Alamofire: 3ec537f71edc9804815215393ae2b1a8ea33a844
19+
Nimble: 04f732da099ea4d153122aec8c2a88fd0c7219ae
20+
Quick: 2623cb30d7a7f41ca62f684f679586558f483d46
2121

2222
PODFILE CHECKSUM: d6370329bd52b0306d7c72b4a2cf75a0248944c9
2323

Vox.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'Vox'
3-
spec.version = '1.2.0'
3+
spec.version = '1.2.1'
44
spec.license = 'MIT'
55
spec.summary = 'A Swift JSONAPI framework'
66
spec.author = 'Aron Balog'

Vox.xcodeproj/project.pbxproj

Lines changed: 72 additions & 56 deletions
Large diffs are not rendered by default.

Vox.xcodeproj/xcshareddata/xcschemes/Vox.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 = "0920"
3+
LastUpgradeVersion = "1010"
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"

Vox/Core/Class/Context.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class Context: NSObject {
3131
let resource = mapResource(for: data)
3232
dataType = .resource(resource)
3333
} else if let data = dictionary["data"] as? NSMutableArray {
34-
let resources = data.flatMap({ (resourceData) -> Resource? in
34+
let resources = data.compactMap({ (resourceData) -> Resource? in
3535
guard let dictionary = resourceData as? NSMutableDictionary else { fatalError("Invalid data type") }
3636
let resource = mapResource(for: dictionary)
3737

@@ -40,7 +40,7 @@ public class Context: NSObject {
4040

4141
dataType = .collection(resources)
4242
} else if let errors = dictionary["errors"] as? NSMutableArray {
43-
let errorObjects = errors.flatMap({ (object) -> ErrorObject? in
43+
let errorObjects = errors.compactMap({ (object) -> ErrorObject? in
4444
guard let object = object as? [String: Any] else { return nil }
4545
return ErrorObject(dictionary: object)
4646
})

Vox/Core/Class/Context_Query.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension Context {
1717
let data = relationshipDocumentData["data"]
1818
if let arrayOfBasicObjects = data as? NSMutableArray {
1919

20-
value = arrayOfBasicObjects.flatMap({ (basicObject) -> Resource? in
20+
value = arrayOfBasicObjects.compactMap({ (basicObject) -> Resource? in
2121
return resourcePool.resource(forBasicObject: basicObject as! [String: String])
2222
})
2323
} else if let basicObject = data as? NSMutableDictionary {

Vox/Core/Networking/Protocol/FetchPageable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public extension Document where DataType: Collection, DataType.Element: Resource
106106
if let array = document.context.dictionary["data"] as? [Any] {
107107
let selfData = self.context.dictionary["data"] as? NSMutableArray
108108

109-
let resources = array.flatMap({ (resourceJson) -> Resource? in
109+
let resources = array.compactMap({ (resourceJson) -> Resource? in
110110
guard let resourceJson = resourceJson as? NSMutableDictionary else { return nil }
111111
let copy = resourceJson.mutableCopy() as! NSMutableDictionary
112112

0 commit comments

Comments
 (0)