a memory safe timer.
To run the example project, clone the repo, and run pod install
from the Example directory first.
KYTimer is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'KYTimer'
使用时KYTimer需要被强引用,否则会自动释放
_timer = [KYProxyTimer timerWithTimeInterval:1 target:self selector:@selector(timerProxyRun) userInfo:nil repeat:YES];
[_timer addTimerToRunloop:[NSRunLoop currentRunLoop] mode:NSRunLoopCommonModes];
_gcdTimer = [KYGCDTimer timerStartAfter:10 timeInterval:1 action:^{
NSLog(@"基于gcdtimer的定时器");
} queue:dispatch_get_main_queue() repeat:YES];
[_gcdTimer fire];
massyxf, messy007@163.com
KYTimer is available under the MIT license. See the LICENSE file for more info.