NetworkActivityIndicator needs to work with multiple clients

Originator:heiko.wichmann
Number:rdar://17653036 Date Originated:12-Jul-2014
Status:Open Resolved:
Product:iOS SDK Product Version:7.1.2
Classification: Reproducible:
 
Summary:
Since iOS 2.0 the visible state of the networkActivityIndicator can only be set to YES or NO by setting networkActivityIndicatorVisible in UIApplication class. This is not sufficient for modern app design where multiple network connections work intertwined. With third party code added to the mix, it is impossible for the app to keep the networkActivityIndicator in a consistent state.
We need a pair of API calls like this:
- (void)incrementActivityCount
- (void)decrementActivityCount

Steps to Reproduce:
1. Component A calls [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
2. Component B calls [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES];
3. Component A calls [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];


Expected Results:
Network activity indicator still visible (because component B stills performs network activity)

Actual Results:
Network activity indicator hidden (because component A called it to hide)

Comments

http://oleb.net/blog/2009/09/managing-the-network-activity-indicator/


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!