38

I'm trying to figure out what the loading circle animation in the status bar is. A lot of apps, when they load data, have a spinner in the status bar to indicate that the app is loading data, but I can't figure out what its called to implement it. Can someone tell me what it is called?

If you don't know what I'm talking about, but have an iOS device, try loading a web page in Safari and look at the spinner in the status bar. Thats what I'm talking about.

Here is an screenshot I took Its the spinner in the statusbar.

0

5 Answers 5

87

I think what you are looking for is:

[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

Swift 3

UIApplication.shared.isNetworkActivityIndicatorVisible = true

as doc'd here: https://developer.apple.com/documentation/uikit/uiapplication/1623102-isnetworkactivityindicatorvisibl

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, it definitely is. Thank you!
isNetworkActivityIndicatorVisible was deprecated in iOS 13. stackoverflow.com/a/56697071/3815069
6

Same as above just in Swift:

UIApplication.sharedApplication().networkActivityIndicatorVisible = true

Comments

1

For anyone looking for the answer to this is Swift 3, you just set the property isNetworkActivityIndicatorVisible on UIApplication to true.

For instance in the didFinishLaunchingWithOptons function in the app delegate:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {        // Override point for customization after application launch.
    application.isNetworkActivityIndicatorVisible = true

    return true
}

Which basically means:

UIApplication.sharedApplication().isNetworkActivityIndicatorVisible = true

Comments

1

Swift 4

UIApplication.shared.isNetworkActivityIndicatorVisible = true

Comments

-5

It is UIActivityIndicatorView. You can check out its documentation and learn more here: UIActivityIndicatorView

Also, to put it on the status bar, check out this link: Activity Monitor Status Bar

10 Comments

Do I have to add that to the status bar?
Yes. But how nearly every application has it, in the status bar, would I have to add it there myself, or is there a method to call in the UIApplication class methods?
Basically, I don't know how I would add it to the statusbar, since I don't know how far the connection information spans across the bar.
I don't think you can put it on the status bar
Actually maybe you can. Try checking out this link: iphonedevsdk.com/forum/iphone-sdk-development/…
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.