Skip to content

Instantly share code, notes, and snippets.

@zakk4223
Created February 20, 2015 05:40
Show Gist options
  • Save zakk4223/46c8a5379e9c2c0a7271 to your computer and use it in GitHub Desktop.
Save zakk4223/46c8a5379e9c2c0a7271 to your computer and use it in GitHub Desktop.
Modified CSTimeIntervalBase.m frameTick
-(void)frameTick
{
NSTimeInterval interval;
if (self.paused)
{
return;
}
NSDate *newNow = [NSDate date];
if (self.startDate) {
interval = -[self.startDate timeIntervalSinceNow];
} else if (self.endDate) {
interval = [self.endDate timeIntervalSinceNow];
}
self.startDate = newNow;
if (interval < 0)
{
interval = 0;
}
self.text = [self.formatter stringFromInterval:interval];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment