Skip to content

macuenca/CircularProgressTimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

CircularProgressTimer

Circular Progress Timer working demo in Objective-C for iOS 6+

This is my take on a control that is getting too mainstream :) Is a snippet of what I used on the Madrid Bus App:

Component screenshot

The project uses Interface Builder only for the main View Controller, but the circular progress view is built programatically.

No extra frameworks needed, just UIKit.

  1. Copy and paste CircularProgressBarView header and implementation files into your project. Don't forget the circle.png and circle@2x.png files.
  2. Kick-off a timer with a one second interval whose action points to the progress bar drawing method. You can see the full example in MainViewController.m:
    timer = [NSTimer scheduledTimerWithTimeInterval:1.0
                                             target:self
                                           selector:@selector(updateCircularProgressBar)
                                           userInfo:nil
                                            repeats:YES];
  1. In the updateCircularProgressBar method, just call the drawing function passing the total amount of seconds left. Show the remaining amount of time in minutes and seconds is a simple operation:
        minutesLeft = globalTimer / 60;
        secondsLeft = globalTimer % 60;
    
        [self drawCircularProgressBarWithMinutesLeft:minutesLeft secondsLeft:secondsLeft]

About

Circular Progress Timer control for iOS in Objective-C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published