Latest 1.1.0
License MIT
Platforms ios 7.0
  1. Automatically cancel the timer when the timer holder dealloc
  2. Automatically cancel all timer when app did enter background. Resume them manually if necessarily.
  3. Also, Cancel the timer manually if required.


The protocol id has four instance methods as follows:

[resume] : start or resume a timer

[suspend]: suspend the timer

[cancel] : stop the timer


  1. Normal timers

    [RTTimerManager timerWithInterval:repeated:queue:block:] execute the callback in a specified queue

    [RTTimerManager timerWithInterval:repeated:block:] execute the callback in main thread

  2. Countdown timer

    [RTTimerManager countdownTimerWithIdentifier:duration:interval:block]

  3. Display Link

    [RTTimerManager displayLinkWithFrameInterval:block]


Get the timer
__weak typeof(self) werakself = self;
id<RTTimer> timer = [RTTimerManager timerWithInterval:0.1f repeated:YES block:^{
    __strong typeof(weakself) this = weakself;
    //Do your work in the block using this instead of self if necessarily.

Hold it
self.timer = timer;

[self.timer resume];

[self.timer cancel]; //awake it again by `[self.timer resume]`;
self.timer = nil; //cancel forever


Don’t let block retain a strong reference to self

Latest podspec

    "name": "TimerManager",
    "version": "1.1.0",
    "summary": "Automatically & manualy manage the timer life cycle.",
    "description": "Automatically & manualy manage the timer life cycle. nIt can be cancelled when the timer dealloc.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "lzhu": "[email protected]"
    "platforms": {
        "ios": "7.0"
    "source": {
        "git": "",
        "tag": "1.1.0"
    "source_files": [
    "exclude_files": "Classes/Exclude"

Pin It on Pinterest

Share This