Skip to content

Commit

Permalink
chore: add public function docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed May 5, 2021
1 parent fb657d9 commit cfbfcf2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/ExtensionKit/CoreLocation/CLLocationManager.swift
Expand Up @@ -3,6 +3,11 @@ import CoreLocation

public extension CLLocationManager {

/// Request locaton authorization and subscribe to `CLAuthorizationStatus` updates
/// - Parameters:
/// - manager: `CLLocationManager`
/// - type: `AuthorizationType`
/// - Returns: Publisher with `AuthorizationType`
static func requestLocationAuthorization(
with manager: CLLocationManager = .init(),
type: AuthorizationType
Expand All @@ -11,6 +16,7 @@ public extension CLLocationManager {
.eraseToAnyPublisher()
}

/// Authorization access level
enum AuthorizationType: String {
case always, whenInUse
}
Expand Down Expand Up @@ -61,7 +67,6 @@ final class AuthorizationSubscription <S: Subscriber>: NSObject,
}
}


final class AuthorizationPublisher: NSObject, Publisher, CLLocationManagerDelegate, SubscriptionAuthorizationDelegate {

typealias Output = CLAuthorizationStatus
Expand Down

0 comments on commit cfbfcf2

Please sign in to comment.