Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Commit

Permalink
Use private extension
Browse files Browse the repository at this point in the history
  • Loading branch information
delba committed Apr 17, 2016
1 parent 88bb4f4 commit 3dae6b8
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Source/RxPermission.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@ import RxSwift

public extension Permission {

private struct AssociatedKeys {
public var rx_permission: Observable<PermissionStatus> {
return rx_permissionInstance.asObservable()
}

}

private extension Permission {
struct AssociatedKeys {
static var Permission = "rx_permissionInstance"
}

private func doLocked(closure: () -> Void) {
func doLocked(closure: () -> Void) {
objc_sync_enter(self); defer { objc_sync_exit(self) }
closure()
}

var rx_permission: Observable<PermissionStatus> {
return rx_permissionInstance.asObservable()
}

private var rx_permissionInstance: PublishSubject<PermissionStatus> {
var rx_permissionInstance: PublishSubject<PermissionStatus> {
get {
var permission: PublishSubject<PermissionStatus>!
doLocked {
Expand All @@ -62,5 +65,4 @@ public extension Permission {
}
}
}

}

0 comments on commit 3dae6b8

Please sign in to comment.