Skip to content

Instantly share code, notes, and snippets.

@berikv
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berikv/03260115348394595a87 to your computer and use it in GitHub Desktop.
Save berikv/03260115348394595a87 to your computer and use it in GitHub Desktop.
Multiple concurrent networkActivityIndicators
var applicationActivityIndicators = 0
extension UIApplication {
func startActivityIndicator() {
applicationActivityIndicators++
UIApplication.sharedApplication().networkActivityIndicatorVisible = true
}
func stopActivityIndicator() {
applicationActivityIndicators--
if applicationActivityIndicators <= 0 {
UIApplication.sharedApplication().networkActivityIndicatorVisible = false
applicationActivityIndicators = 0
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment