I have some code that shows the time in separate parts (hours, minutes, seconds).
- (void)viewDidLoad
{
[self updateTime];
[super viewDidLoad];
hourFormatter = [[NSDateFormatter alloc] init];
hourFormatter.dateFormat = @"HH";
minuteFormatter = [[NSDateFormatter alloc] init];
minuteFormatter.dateFormat = @"mm";
secondFormatter = [[NSDateFormatter alloc] init];
secondFormatter.dateFormat = @"ss";
}
- (void)updateTime {
[updateTimer invalidate];
updateTimer = nil;
currentTime = [NSDate date];
NSDateFormatter *timeFormatter = [[NSDateFormatter alloc] init];
[timeFormatter setTimeStyle:NSDateFormatterMediumStyle];
hourLabel.text = [hourFormatter stringFromDate: currentTime];
minuteLabel.text = [minuteFormatter stringFromDate: currentTime];
secondLabel.text = [secondFormatter stringFromDate: currentTime];
updateTimer = [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(updateTime) userInfo:nil repeats:YES];
}
I want to have three bars (for hours, minutes, seconds) that rise as time increases. Exactly like this cydia lockscreen tweak: http://patrickmuff.ch/repo/
EDIT: I should add that I am extremely new to Objective-C and very inexperienced so any tips/help is greatly appreciated!