Skip to content

Commit a89eaac

Browse files
authored
Merge branch 'master' into CoreCancel
2 parents 35149e1 + 1588933 commit a89eaac

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ matrix:
1414
- {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=3.3 DST="OS=11.4,name=iPhone 5s"'}
1515
- {osx_image: xcode9.4, env: 'PLAT=tvOS SWFT=3.3 DST="OS=11.4,name=Apple TV"'}
1616

17+
- {osx_image: xcode10, env: 'PLAT=macOS SWFT=3.4 DST="arch=x86_64"'}
18+
- {osx_image: xcode10, env: 'PLAT=iOS SWFT=3.4 DST="OS=12.0,name=iPhone SE"'}
19+
- {osx_image: xcode10, env: 'PLAT=tvOS SWFT=3.4 DST="OS=12.0,name=Apple TV"'}
20+
1721
- {osx_image: xcode9.2, env: 'PLAT=macOS SWFT=4.0 DST="arch=x86_64"'}
1822
- {osx_image: xcode9.2, env: 'PLAT=iOS SWFT=4.0 DST="OS=11.2,name=iPhone SE"'}
1923
- {osx_image: xcode9.2, env: 'PLAT=tvOS SWFT=4.0 DST="OS=11.2,name=Apple TV"'}
@@ -25,6 +29,10 @@ matrix:
2529
- {osx_image: xcode9.4, env: 'PLAT=iOS SWFT=4.1 DST="OS=11.4,name=iPhone 5s" TEST=1'}
2630
- {osx_image: xcode9.3, env: 'PLAT=tvOS SWFT=4.1 DST="OS=10.2,name=Apple TV 1080p"'}
2731
- {osx_image: xcode9.4, env: 'PLAT=tvOS SWFT=4.1 DST="OS=11.4,name=Apple TV" TEST=1'}
32+
33+
- {osx_image: xcode10, env: 'PLAT=macOS SWFT=4.2 DST="arch=x86_64"'}
34+
- {osx_image: xcode10, env: 'PLAT=iOS SWFT=4.2 DST="OS=12.0,name=iPhone SE"'}
35+
- {osx_image: xcode10, env: 'PLAT=tvOS SWFT=4.2 DST="OS=12.0,name=Apple TV"'}
2836
cache:
2937
directories:
3038
- Carthage

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "dougzilla32/PromiseKit" "dcf77e0afe55e3d18da9a2a5bda28cdf1adcb5a9"
1+
github "dougzilla32/PromiseKit" "dcf77e0afe55e3d18da9a2a5bda28cdf1adcb5a9"

Sources/MKDirections+Promise.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ import PromiseKit
1414
import PromiseKit
1515
*/
1616
extension MKDirections {
17+
#if swift(>=4.2)
18+
/// Begins calculating the requested route information asynchronously.
19+
public func calculate() -> Promise<Response> {
20+
return Promise { calculate(completionHandler: $0.resolve) }
21+
}
22+
23+
/// Begins calculating the requested travel-time information asynchronously.
24+
public func calculateETA() -> Promise<ETAResponse> {
25+
return Promise { calculateETA(completionHandler: $0.resolve) }
26+
}
27+
#else
1728
/// Begins calculating the requested route information asynchronously.
1829
public func calculate() -> Promise<MKDirectionsResponse> {
1930
return Promise<MKDirectionsResponse>(cancellableTask: MKDirectionsTask(self)) { calculate(completionHandler: $0.resolve) }
@@ -23,6 +34,7 @@ extension MKDirections {
2334
public func calculateETA() -> Promise<MKETAResponse> {
2435
return Promise<MKETAResponse>(cancellableTask: MKDirectionsTask(self)) { calculateETA(completionHandler: $0.resolve) }
2536
}
37+
#endif
2638
}
2739

2840
private class MKDirectionsTask: CancellableTask {

Sources/MKMapSnapshotter+Promise.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,17 @@ import PromiseKit
1414
import PromiseKit
1515
*/
1616
extension MKMapSnapshotter {
17+
#if swift(>=4.2)
18+
/// Starts generating the snapshot using the options set in this object.
19+
public func start() -> Promise<Snapshot> {
20+
return Promise { start(completionHandler: $0.resolve) }
21+
}
22+
#else
1723
/// Starts generating the snapshot using the options set in this object.
1824
public func start() -> Promise<MKMapSnapshot> {
1925
return Promise<MKMapSnapshot>(cancellableTask: MKMapSnapshotterTask(self)) { start(completionHandler: $0.resolve) }
2026
}
27+
#endif
2128
}
2229

2330
private class MKMapSnapshotterTask: CancellableTask {

0 commit comments

Comments
 (0)