iOS Progress Bar (Progress View) With Examples

In this tutorial, we’ll be discussing the UIProgressView component and create a progress bar in our iOS Application.

iOS Progress Bar – UIProgressView

ProgressView is used to display the progress of any long running activity such as downloading/uploading/waiting for a response from web service to the user. This is a vital UI element which when absent could give the users an impression that the application is not responding.

Launch XCode Single View iOS Application. Let’s add the UIProgressView in our Main.storyboard

ProgressView can have a value between 0.0 and 1.0 and would be indicated by the blue color.
Values outside this interval would be rounded off to either of them depending on whether it’s greater than 1.0 or less than 0.0.

iOS Progress View Properties

ProgressView has the following properties:

  • progressTintColor – Used to change the UIColor of the progress part i.e. the filled part in the ProgressView.
  • trackTintColor – Used to change the UIColor of the track i.e. the unfilled part of the ProgressView.
  • ProgressBarStyle – There are two styles: default and bar. The bar style has a transparent track.
  • trackImage – Here an image is used instead of color for the unfilled part.
  • progressImage – Image is used to show the progress.

Let’s begin our implementation. Our Main.storyboard contains a button to start/stop the ProgressView.


The code for the ViewController.swift class is given below:

IBOutlet and IBActions are created by linking the Main.storyboard views to the Swift file.

We start a Timer when the Button is clicked which updates the progress bar through the selector function passed: updateProgressView.

Every alternate timer would toggle the style of the ProgressView.

The output of the above application when run on the simulator is given below:

ios progressview output

Increasing the Height of the ProgressView

We can change the height of the ProgressView in the following way:

This transforms the height by 8 times. Let’s see how it looks in the simulator.


You can also change the height from the storyboard in the constraints:

The second approach is better since the first one might pixelate the ProgressView if we try to shape the edges.

Rounded Corners ProgressBar

Add the following code in the viewDidLoad() function.

We set the corner radius to half of the height of the ProgressView. Following is the output of the application with the updated code.

ios rounded progress bar

This brings an end to this tutorial. You can download the project from the link below:

By admin

Leave a Reply

%d bloggers like this: