CocoaPods trunk is moving to be read-only. Read more on the blog, there are 12 months to go.

WTTimer 0.0.3

WTTimer 0.0.3

Maintained by windter sharp.



WTTimer 0.0.3

  • By
  • windtersharp

CocoaPods Compatible

This library provides a category for NSTimer. You don't need to invoke the invalidate method in timer manually, which can avoid memory leak that caused by circular reference.

Installation

NSTimer supports CocoaPods for installing the library in a project.

Podfile

To integrate NSTimer into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
target 'TargetName' do
  pod 'WTTimer'         
end

Then, run the following command:

$ pod install

Usage

It is the same as the system native method, and you don't need to invoke the invalidate method in timer manually,

   
NSTimer  *timer = [NSTimer wt_scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(log) userInfo:nil repeats:YES];
[timer invalidate]; // Not necessary