Skip to content

Commit 29bdbf6

Browse files
authored
Merge branch 'master' into CoreCancel
2 parents 8091870 + 1588933 commit 29bdbf6

File tree

2 files changed

+66
-66
lines changed

2 files changed

+66
-66
lines changed

Sources/MKDirections+Promise.swift

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
1-
import MapKit
2-
#if !PMKCocoaPods
3-
import PromiseKit
4-
#endif
5-
6-
/**
7-
To import the `MKDirections` category:
8-
9-
use_frameworks!
10-
pod "PromiseKit/MapKit"
11-
12-
And then in your sources:
13-
14-
import PromiseKit
15-
*/
16-
extension MKDirections {
17-
#if swift(>=4.2)
18-
/// Begins calculating the requested route information asynchronously.
19-
public func calculate() -> Promise<Response> {
20-
return Promise<Response>(cancellableTask: MKDirectionsTask(self)) { calculate(completionHandler: $0.resolve) }
21-
}
22-
23-
/// Begins calculating the requested travel-time information asynchronously.
24-
public func calculateETA() -> Promise<ETAResponse> {
25-
return Promise<ETAResponse>(cancellableTask: MKDirectionsTask(self)) { calculateETA(completionHandler: $0.resolve) }
26-
}
27-
#else
28-
/// Begins calculating the requested route information asynchronously.
29-
public func calculate() -> Promise<MKDirectionsResponse> {
30-
return Promise<MKDirectionsResponse>(cancellableTask: MKDirectionsTask(self)) { calculate(completionHandler: $0.resolve) }
31-
}
32-
33-
/// Begins calculating the requested travel-time information asynchronously.
34-
public func calculateETA() -> Promise<MKETAResponse> {
35-
return Promise<MKETAResponse>(cancellableTask: MKDirectionsTask(self)) { calculateETA(completionHandler: $0.resolve) }
36-
}
37-
#endif
38-
}
1+
import MapKit
2+
#if !PMKCocoaPods
3+
import PromiseKit
4+
#endif
5+
6+
/**
7+
To import the `MKDirections` category:
8+
9+
use_frameworks!
10+
pod "PromiseKit/MapKit"
11+
12+
And then in your sources:
13+
14+
import PromiseKit
15+
*/
16+
extension MKDirections {
17+
#if swift(>=4.2)
18+
/// Begins calculating the requested route information asynchronously.
19+
public func calculate() -> Promise<Response> {
20+
return Promise<Response>(cancellableTask: MKDirectionsTask(self)) { calculate(completionHandler: $0.resolve) }
21+
}
22+
23+
/// Begins calculating the requested travel-time information asynchronously.
24+
public func calculateETA() -> Promise<ETAResponse> {
25+
return Promise<ETAResponse>(cancellableTask: MKDirectionsTask(self)) { calculateETA(completionHandler: $0.resolve) }
26+
}
27+
#else
28+
/// Begins calculating the requested route information asynchronously.
29+
public func calculate() -> Promise<MKDirectionsResponse> {
30+
return Promise<MKDirectionsResponse>(cancellableTask: MKDirectionsTask(self)) { calculate(completionHandler: $0.resolve) }
31+
}
32+
33+
/// Begins calculating the requested travel-time information asynchronously.
34+
public func calculateETA() -> Promise<MKETAResponse> {
35+
return Promise<MKETAResponse>(cancellableTask: MKDirectionsTask(self)) { calculateETA(completionHandler: $0.resolve) }
36+
}
37+
#endif
38+
}
3939

4040
private class MKDirectionsTask: CancellableTask {
4141
let directions: MKDirections

Sources/MKMapSnapshotter+Promise.swift

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
import MapKit
2-
#if !PMKCocoaPods
3-
import PromiseKit
4-
#endif
5-
6-
/**
7-
To import the `MKMapSnapshotter` category:
8-
9-
use_frameworks!
10-
pod "PromiseKit/MapKit"
11-
12-
And then in your sources:
13-
14-
import PromiseKit
15-
*/
16-
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<Snapshot>(cancellableTask: MKMapSnapshotterTask(self)) { start(completionHandler: $0.resolve) }
21-
}
22-
#else
23-
/// Starts generating the snapshot using the options set in this object.
24-
public func start() -> Promise<MKMapSnapshot> {
25-
return Promise<MKMapSnapshot>(cancellableTask: MKMapSnapshotterTask(self)) { start(completionHandler: $0.resolve) }
26-
}
27-
#endif
28-
}
1+
import MapKit
2+
#if !PMKCocoaPods
3+
import PromiseKit
4+
#endif
5+
6+
/**
7+
To import the `MKMapSnapshotter` category:
8+
9+
use_frameworks!
10+
pod "PromiseKit/MapKit"
11+
12+
And then in your sources:
13+
14+
import PromiseKit
15+
*/
16+
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<Snapshot>(cancellableTask: MKMapSnapshotterTask(self)) { start(completionHandler: $0.resolve) }
21+
}
22+
#else
23+
/// Starts generating the snapshot using the options set in this object.
24+
public func start() -> Promise<MKMapSnapshot> {
25+
return Promise<MKMapSnapshot>(cancellableTask: MKMapSnapshotterTask(self)) { start(completionHandler: $0.resolve) }
26+
}
27+
#endif
28+
}
2929

3030
private class MKMapSnapshotterTask: CancellableTask {
3131
let snapshotter: MKMapSnapshotter

0 commit comments

Comments
 (0)