Skip to content

Instantly share code, notes, and snippets.

@gregpardo
Last active February 1, 2019 02:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregpardo/1c027d20ccc3d5e1381876baf5346e03 to your computer and use it in GitHub Desktop.
Save gregpardo/1c027d20ccc3d5e1381876baf5346e03 to your computer and use it in GitHub Desktop.
rx_animating extension for NVActivityIndicatorView
extension NVActivityIndicatorView {
public var rx_animating: AnyObserver<Bool> {
return UIBindingObserver(UIElement: self) { indicator, animating in
if (animating) {
indicator.startAnimation()
} else {
indicator.stopAnimation()
}
}.asObserver()
}
}
@mariojuni
Copy link

How to apply this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment