ios-nd-networking
ios-nd-networking copied to clipboard
Use spinner in the status bar for long running network requests.
We use a UIActivityIndicatorView
on the login screen to signal network activity. Apps will also signal network activity for other types of long running tasks (like image downloads).
There's not always a place for an activity indicator view, but iOS does provide the same spinning animation in the status bar. You can enable it with
UIApplication.shared.isNetworkActivityIndicatorVisible = true
And disable it by setting the property to false
.
For this task, try using a UIActivityIndicatorView
or the one in the status bar, to signal in-progress network requests in another part of the app, like loading the image on the detail view..
Is it right to handle this funcion in setLoggingIn in LoginViewController?
Is it right to handle this funcion in setLoggingIn in LoginViewController?
We already basically have this functionality in the LoginViewController when we added the activity spinner underneath the login buttons. He wants us to add it to the other view controllers where heavy network requests are being created.
Like the search view controller or the movie detail view controller when images are being downloaded.
However, if you do want to add the network indicator. Putting it inside the setLoggingIn would work.
If you are using an iPhone X, XS or XS max, the network activity indicator will never be visible.
This issue is only relevant to iPhone 8 and prior.