Last active
February 1, 2019 02:48
-
-
Save gregpardo/1c027d20ccc3d5e1381876baf5346e03 to your computer and use it in GitHub Desktop.
rx_animating extension for NVActivityIndicatorView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NVActivityIndicatorView { | |
public var rx_animating: AnyObserver<Bool> { | |
return UIBindingObserver(UIElement: self) { indicator, animating in | |
if (animating) { | |
indicator.startAnimation() | |
} else { | |
indicator.stopAnimation() | |
} | |
}.asObserver() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to apply this ?