I have a 45 seconds countdown made with a NSTimer which look like this:
-(IBAction)Start {
mainInt = 45;
timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(countDown) userInfo:nil repeats:YES]; }
- (void)countDown {
mainInt -= 1;
seconds.text = [NSString stringWithFormat:@"%i", mainInt];
if (mainInt == 0) {
[timer invalidate];
}
Then i placed a simple UIProgressView in my storyboard. I tried linking both together without code but it's obviously not that easy. How can i link the UIProgressView to the NSTimer to make sure that the Progress bar gets full once the countdown reach 0?