Declared in NSTimer+BlocksKit.h

Overview

Simple category on NSTimer to give it blocks capability.

Created by Jiva DeVoe as NSTimer-Blocks.

Tasks

Class Methods

bk_scheduledTimerWithTimeInterval:block:repeats:

+ (NSTimer *)bk_scheduledTimerWithTimeInterval:(NSTimeInterval)inTimeInterval block:(void ( ^ ) ( NSTimer *timer ))inBlock repeats:(BOOL)inRepeats
Discussion

Creates and returns a block-based NSTimer object and schedules it on the current run loop.

Parameters

inTimeInterval

The number of seconds between firings of the timer.

inBlock

The block that the NSTimer fires.

inRepeats

If YES, the timer will repeatedly reschedule itself until invalidated. If NO, the timer will be invalidated after it fires.

Return Value

A new NSTimer object, configured according to the specified parameters.

Declared In

NSTimer+BlocksKit.h

bk_timerWithTimeInterval:block:repeats:

+ (NSTimer *)bk_timerWithTimeInterval:(NSTimeInterval)inTimeInterval block:(void ( ^ ) ( NSTimer *timer ))inBlock repeats:(BOOL)inRepeats
Discussion

Creates and returns a block-based NSTimer initialized with the specified block.

You must add the new timer to a run loop, using -addTimer:forMode:. Then, after seconds seconds have elapsed, the timer fires the block. If the timer is configured to repeat, there is no need to subsequently re-add the timer.

Parameters

inTimeInterval

The number of seconds between firings of the timer.

inBlock

The block that the NSTimer fires.

inRepeats

If YES, the timer will repeatedly reschedule itself until invalidated. If NO, the timer will be invalidated after it fires.

Return Value

A new NSTimer object, configured according to the specified parameters.

Declared In

NSTimer+BlocksKit.h