Skip to content

Instantly share code, notes, and snippets.

@hechen
Created March 18, 2019 07:34
Show Gist options
  • Save hechen/f38313d4ff349371b6e70075747fb12d to your computer and use it in GitHub Desktop.
Save hechen/f38313d4ff349371b6e70075747fb12d to your computer and use it in GitHub Desktop.
Bindable sink for `loading` and property.
#if os(macOS)
import Cocoa
import RxSwift
import RxCocoa
extension Reactive where Base: NSProgressIndicator {
/// Bindable sink for `loading` and property.
public var loading: Binder<Bool> {
return Binder(self.base) { indicator, value in
indicator.loading = value
}
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment