Skip to content

Commit 706800d

Browse files
committed
update
1 parent 27cd12b commit 706800d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Sources/d3-async-location/LocationManagerAsync+/Delegate.swift

+7-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ extension LocationManagerAsync{
1414
@available(iOS 14.0, watchOS 7.0, *)
1515
final class Delegate: NSObject, CLLocationManagerDelegate{
1616

17-
/// Continuation asynchronously passing location data
18-
var stream: Streaming?{
17+
/// Continuation passing location data
18+
private var stream: Streaming?{
1919
didSet {
2020
stream?.onTermination = { @Sendable [weak self] termination in
2121
self?.onTermination(termination)
@@ -25,6 +25,11 @@ extension LocationManagerAsync{
2525

2626
// MARK: - Delegate
2727

28+
/// Set stream
29+
/// - Parameter continuation: Continuation passing location data
30+
public func setStream(with continuation : Streaming){
31+
stream = continuation
32+
}
2833

2934
/// Stop streaming
3035
public func finish(){

Sources/d3-async-location/LocationManagerAsync.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ final class LocationManagerAsync: ILocationManagerAsync{
7878

7979
/// Start updating
8080
private func streaming(with continuation : Streaming){
81-
delegate.stream = continuation
81+
delegate.setStream(with: continuation)
8282
manager.startUpdatingLocation()
8383
}
8484

0 commit comments

Comments
 (0)