Inherits from NSObject
Declared in NGLTimer.h

Overview

(Internal only) This is a singleton class. It’s the main loop for all NinevehGL’s core. (Singleton)

This class creates a single unique loop running with the interval defined by the constant NGL_MAX_FPS in NGLCoreTimer. The NGL_MAX_FPS represents the number of loop for each second.

As the NGLTimer is a singleton class, it can’t be instantiated, so to call any method from it you must call the defaultTimer which will return the singleton instance for you.

This class is not responsible for any delay or any filter for each callback. Actually, the NGLTimer works like a library, holding the items with a retain message and calling the callback function inside each item through the loop cycles. The items must conform to the NGLCoreTimer protocol to be added.

The loop will start automatically when the singleton instance is called by the first time. You can stop and restart the loop.

Tasks

Properties

paused

Pauses or resumes the timer.

@property (nonatomic, getter=isPaused) BOOL paused

Discussion

Pauses or resumes the timer.

Set this property to YES if you want to pause the animation temporary. Set it to NO again to resume the timer.

Its default value is NO.

Declared In

NGLTimer.h

Class Methods

defaultTimer

Returns the singleton instance of NGLTimer.

+ (NGLTimer *)defaultTimer

Return Value

A singleton NGLTimer instance.

Discussion

Returns the singleton instance of NGLTimer.

This method is the point of access to the NGLTimer singleton instance. All the classes that work with loop make use of NGLTimer to deal with the cycle.

Declared In

NGLTimer.h

Instance Methods

addItem:

Adds an item from the loop cycle.

- (void)addItem:(id<NGLCoreTimer>)item

Parameters

item

The object to be added, it must conform to NGLCoreTimer protocol.

Discussion

Adds an item from the loop cycle.

The items can’t be duplicated, NGLTimer automatically will ignore attempts to insert the same item more than one time.

Declared In

NGLTimer.h

removeAll

Removes all items from the loop cycle.

- (void)removeAll

Discussion

Removes all items from the loop cycle.

Declared In

NGLTimer.h

removeItem:

Removes an item from the loop cycle.

- (void)removeItem:(id<NGLCoreTimer>)item

Parameters

item

The object to be removed, it must conform to NGLCoreTimer protocol.

Discussion

Removes an item from the loop cycle.

Declared In

NGLTimer.h