I'm currently trying to make the global activity indicator fast, which is called whenever the api is fetched. The idea is that the activity indicator appears in the upper left corner of the navigation panel (child controller of the navigation controller) and is available on each page of the application.
Unable to show sample image due to new account / low reputation
My activity indicator is displayed correctly, I'm just not sure how to make it accessible from any page of the application - I reviewed the extension, but I'm not sure what the best way to get closer to it, Any help would be greatly appreciated.
Activity indicator code:
let activityIndicator: UIActivityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.White)
var activityItem = UIBarButtonItem()
func navBarActivity() {
activityIndicator.startAnimating()
activityIndicator.hidden = false
self.activityItem = UIBarButtonItem(customView: activityIndicator)
self.navigationItem.leftBarButtonItem = activityItem
}
source
share