ios-nd-networking icon indicating copy to clipboard operation
ios-nd-networking copied to clipboard

Use spinner in the status bar for long running network requests.

Open OwenLaRosa opened this issue 5 years ago • 3 comments

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..

OwenLaRosa avatar Nov 09 '18 22:11 OwenLaRosa

Is it right to handle this funcion in setLoggingIn in LoginViewController?

aslangaslan avatar Dec 09 '18 19:12 aslangaslan

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.

BrentMifsud avatar Jun 01 '19 22:06 BrentMifsud

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.

BrentMifsud avatar Jun 01 '19 22:06 BrentMifsud