PMTweenBeat Class Reference
Inherits from | NSObject |
Conforms to | PMTweenTempoDelegate |
Declared in | PMTweenBeat.h PMTweenBeat.m |
Overview
PMTweenBeat broadcasts updates from a PMTweenTempo object to multiple objects which adopt the PMTweening
protocol. This allows you to use a single tempo object for all tween objects, avoiding a performance impact when tweening many objects. In most cases PMTweenGroup
can be used for the same purpose, albeit with less cheekiness.
Tasks
Creating an Instance
Setting Up a Beat
-
– addTween:
-
– removeTween:
-
tweens
property -
paused
property
Other Methods
Properties
paused
A Boolean determining whether tempo updates should be paused.
@property (nonatomic, assign) BOOL paused
Declared In
PMTweenBeat.h
tweens
An array comprising the tween objects which receive tempo updates. (read-only)
@property (readonly, nonatomic, strong) NSArray *tweens
Declared In
PMTweenBeat.h
Instance Methods
addTween:
Adds an object to the list of objects PMTweenBeat should broadcast a tempo beat to.
- (void)addTween:(NSObject<PMTweening> *)tween
Parameters
- tween
An object which adopts the
PMTweening
protocol.
Declared In
PMTweenBeat.h
initWithTempo:
Initializes a new PMTweenBeat object and registers the supplied PMTweenTempo.
- (instancetype)initWithTempo:(PMTweenTempo *)tempo
Parameters
- tempo
A subclass of PMTweenTempo, which provides the heartbeat for PMTweenBeat.
Return Value
A new instance of this class
Discussion
Warning: Do not pass an instance of PMTweenTempo; instead use a subclass and implement the PMTweenTempoDelegate protocol.
Declared In
PMTweenBeat.h
removeTween:
Removes the specified object from the broadcast list.
- (void)removeTween:(NSObject<PMTweening> *)tween
Parameters
- tween
The tween object to remove.
Declared In
PMTweenBeat.h
tempoBeatWithTimestamp:
Sends an update beat that should prompt tweening classes to recalculate tween values.
- (void)tempoBeatWithTimestamp:(NSTimeInterval)timestamp
Parameters
- timestamp
A timestamp with the current time, by which tween classes can calculate new tween values.
Declared In
PMTweenTempo.h