Using UIProgressView

Progress views enable your users to follow task progress as it happens rather than just saying “Please wait.” They present bars that fill over time. The bars indicate the degree to which a task has finished. Progress bars work best for long waits where providing state feedback enables your users to retain the feeling of control.

To create a progress view, allocate a UIProgressView instance and set its frame. To use the bar, issue setProgress:. This takes one argument, a floating-point number that ranges between 0% (0.0, no progress) and 100% (1.0, finished). Progress view bars come in two styles: basic white and light gray. The setStyle: method chooses the kind you prefer, either UIProgressViewStyleDefault or UIProgressViewStyleBar ...

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.