Alert Indicators

When an application accesses the Internet from behind the scenes, it’s polite to let your user know what’s going on. You don’t have to create a full-screen alert because Cocoa Touch provides a simple application property that controls a spinning network activity indicator in the status bar. Figure 3-6 shows this indicator in action, to the right of the Wi-Fi indicator and to the left of the current time display.

Image

Figure 3-6 The network activity indicator is controlled by a UIApplication property.

The following snippet demonstrates how to access this property, which requires you to do little more than toggle the indicator on or ...

Get The Core iOS Developer’s Cookbook, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.