Latest0.0.1
Homepagehttps://github.com/rnapier/RNTimer
LicenseCopyright Copyright (C) Rob Napier. All Right Reserved.
Platformsios 5.0, requires ARC
FrameworksFoundation
Authors

Simple GCD-based timer based on NSTimer. It starts immediately and stops when released.
This avoids many of the typical problems with NSTimer:

  • RNTimer runs in all modes (unlike NSTimer)
  • RNTimer runs when there is no runloop (unlike NSTimer)
  • Repeating RNTimers can easily avoid retain loops (unlike NSTimer)

Currently there is only a simple repeating timer (since this is the most common use that’s
hard to do correctly with NSTimer). It always runs on the main queue.

USAGE

__weak id weakSelf = self;
self.timer =
    [RNTimer repeatingTimerWithTimeInterval:1
                                      block:^{
                                        [weakSelf doSomething];
                                      }];

BACKGROUND

http://robnapier.net/blog/simple-gcd-timer-rntimer-762

Latest podspec

{
    "name": "RNTimer",
    "version": "0.0.1",
    "license": {
        "type": "Copyright",
        "text": "               Copyright (C) Rob Napier. All Right Reserved.n"
    },
    "summary": "Simple GCD-based timer based on NSTimer.",
    "homepage": "https://github.com/rnapier/RNTimer",
    "authors": {
        "Rob Napier": "[email protected]"
    },
    "source": {
        "git": "https://github.com/rnapier/RNTimer.git",
        "commit": "fdb2f4c302e1049db4a674e24508858e9da892e0"
    },
    "source_files": "RNTimer/RNTimer.{h,m}",
    "platforms": {
        "ios": "5.0"
    },
    "frameworks": "Foundation",
    "requires_arc": true
}

Pin It on Pinterest

Share This