harsh_v
harsh_v

Reputation: 3269

iOS network activity indicator is not showing

I am using Alamofire networking library to make requests.

I am performing several different tasks like.

But the network activity indicator is not showing in the status bar for any of the operation.

What can be a possible reason for this behavior?

Is that a thing to worry?

Upvotes: 1

Views: 7186

Answers (5)

Anirudha Mahale
Anirudha Mahale

Reputation: 2596

I did what wattson12 answers asked me to do but it didn't work.

You also need to add the below line as by default start delay for the indicator is 1.

NetworkActivityIndicatorManager.shared.startDelay = 0

If what you are querying is very simple and returns the response within 1 seconds then it won't even show up.

Upvotes: 1

Inder Kumar Rathore
Inder Kumar Rathore

Reputation: 39978

You've to turn on/off network indicator manually, this is not default behaviour. Here is how you do it

[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];


Swift code

UIApplication.shared.isNetworkActivityIndicatorVisible = true

Upvotes: 5

Tom Baranowicz
Tom Baranowicz

Reputation: 111

Swift 3.0 compatible code:

UIApplication.shared.isNetworkActivityIndicatorVisible = true

Upvotes: 2

Ketan Parmar
Ketan Parmar

Reputation: 27428

You should manually show network activity indicator like,

  UIApplication.sharedApplication().networkActivityIndicatorVisible = true

and false when want to hide. it will not shown by default.

Hope this will help :)

Upvotes: 0

wattson12
wattson12

Reputation: 11174

Since you are using Alamofire you should be using the companion library: https://github.com/Alamofire/AlamofireNetworkActivityIndicator

From their readme, all you need to do is NetworkActivityIndicatorManager.sharedManager.isEnabled = true

Upvotes: 4

Related Questions