Create one UILable
in your RootViewController
or UIWindow
and then update it frequently with following way.
create one Variable
in .h
file.
@property (nonatomic) int seconds;
put following code
in ViewDidLoad
method of your RootViewController
NSTimer * timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateLabel) userInfo:nil repeats:YES];
[timer fire];
Create following Function
to update UILabel
.
- (void) updateLabel {
self.seconds = self.seconds + 1;
NSLog(@"You can show time in minutes, hours and day also after doing some calculation as per your need");
[self.lblDemo setText:[NSString stringWithFormat:@"%d seconds",self.seconds]];
}