Network Activity Indicator

I’d like to turn on the progress wheel beside the wifi indicator at the very top of my iPhone screen, like the Apple apps, Facebook app and other network apps do when I am doing some network activity.

According to this StackOverflow answer (http://stackoverflow.com/questions/11855823/how-do-you-get-the-network-progress-spinner-to-show-up-in-ios) I would need to do the equivalent of:

[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;

Is there (or would somebody care to craft…) a declare for this?

It’s in the next version of iOSKit which I plan to commit today or later tonight but in the mean time here you go. (This version is untested since I’m on my phone)

[code]Declare function NSClassFromString lib “Foundation” (clsName as cfstringref) as ptr
Declare function sharedApplication lib “UIKit” selector “sharedApplication” (clsRef as ptr) as ptr
Declare sub setNetworkActivity lib “UIKit” selector “setNetworkActivityIndicatorVisible:” (obj_id as ptr, yesNo as Boolean)

SetNetworkActivity(sharedApplication(NSClassFromString(“UIApplication”)), true)[/code]

It works like a charm. Thank you Jason. :slight_smile: