PMTweenGroup Class Reference
| Inherits from | NSObject |
| Conforms to | PMTweenTempoDelegate PMTweening |
| Declared in | PMTweenGroup.h PMTweenGroup.m |
Overview
PMTweenGroup handles the tweening of one or more objects which conform to the PMTweening protocol, either being instances of PMTweenUnit or other custom classes. The PMTweenGroup class is a good solution when you want to easily synchronize the operation of many tweens.
Tasks
Creating an Instance
Setting Up a Group
-
– addTween: -
– addTween:useTweenTempo: -
– addTweens: -
– removeTween: -
delayproperty -
repeatingproperty -
numberOfRepeatsproperty -
syncTweensWhenReversingproperty
Tween State
-
tweenStateproperty -
tweenDirectionproperty -
tweensproperty -
cyclesCompletedCountproperty
Notification Blocks
-
startBlockproperty -
stopBlockproperty -
updateBlockproperty -
repeatCycleBlockproperty -
reverseBlockproperty -
pauseBlockproperty -
resumeBlockproperty -
completeBlockproperty
Controlling a Tween
Properties
completeBlock
This notification block is executed when a tween operation has completed (or when all tween cycles have completed, if repeating is set to YES).
@property (nonatomic, copy) PMTweenDidCompleteBlock completeBlockDeclared In
PMTweenGroup.hcyclesCompletedCount
The number of completed tween cycles. (read-only)
@property (readonly, nonatomic, assign) NSUInteger cyclesCompletedCountDiscussion
@remarks A cycle represents the total length of tweening operation.
See Also
Declared In
PMTweenGroup.hdelay
The delay, in seconds, before a tween operation begins.
@property (nonatomic, assign) NSTimeInterval delayDiscussion
Warning: Setting this parameter after a tween operation has begun has no effect.
Declared In
PMTweenGroup.hnumberOfRepeats
The number of tween cycle operations to repeat.
@property (nonatomic, assign) NSUInteger numberOfRepeatsDiscussion
@remarks This property is only used when repeating is set to YES. Negative values are clamped to 0. The default value is 0.
See Also
Declared In
PMTweenGroup.hpauseBlock
This notification block is executed when calling the pauseTween method on this instance causes a tween operation to pause.
@property (nonatomic, copy) PMTweenDidPauseBlock pauseBlockSee Also
Declared In
PMTweenGroup.hrepeatCycleBlock
This notification block is executed when a tween cycle has completed.
@property (nonatomic, copy) PMTweenDidRepeatBlock repeatCycleBlockDeclared In
PMTweenGroup.hrepeating
A Boolean which determines whether a group’s tween operation should repeat.
@property (nonatomic, assign) BOOL repeatingDiscussion
@remarks When set to YES, each tween object in the group repeats its tween cycle for the number of times specified by the numberOfRepeats property. The default value is NO.
See Also
Declared In
PMTweenGroup.hresumeBlock
This notification block is executed when calling the resumeTween method on this instance causes a tween operation to resume.
@property (nonatomic, copy) PMTweenDidResumeBlock resumeBlockSee Also
Declared In
PMTweenGroup.hreverseBlock
This notification block is executed when this instance’s tweenDirection property changes to PMTweenDirectionReverse.
@property (nonatomic, copy) PMTweenDidReverseBlock reverseBlockSee Also
@property tweenDirection, reversing
Declared In
PMTweenGroup.hstartBlock
This notification block is executed when calling the startTween method on this instance causes a tween operation to start.
@property (nonatomic, copy) PMTweenDidStartBlock startBlockSee Also
Declared In
PMTweenGroup.hstopBlock
This notification block is executed when calling the stopTween method on this instance causes a tween operation to stop.
@property (nonatomic, copy) PMTweenDidStopBlock stopBlockSee Also
Declared In
PMTweenGroup.hsyncTweensWhenReversing
A Boolean which determines whether a group’s tween objects should pause until all objects are ready to reverse directions.
@property (nonatomic, assign) BOOL syncTweensWhenReversingDiscussion
@remarks When set to YES, the group does not reverse direction until all objects have completed their current tween. This property only has an effect when reversing is set to YES. It posts a PMTweenDidReverseNotification notification when all of its tween objects are ready to reverse. When set to NO, its tween objects will reverse independently of each other. The default value is YES.
Declared In
PMTweenGroup.htweenDirection
A PMTweenDirection enum which represents the current direction of the tween operation. (read-only)
@property (readonly, nonatomic, assign) PMTweenDirection tweenDirectionDeclared In
PMTweenGroup.htweenState
A PMTweenState enum which represents the current state of the tween operation. (read-only)
@property (readonly, nonatomic, assign) PMTweenState tweenStateDeclared In
PMTweenGroup.htweens
An array comprising the tween objects which are controlled by this PMTweenGroup object. (read-only)
@property (readonly, nonatomic, strong) NSArray *tweensDeclared In
PMTweenGroup.hupdateBlock
This notification block is executed when the updateWithTimeInterval:currentTime: method is called on this instance while this instance’s tweenState is PMTweenStateTweening.
@property (nonatomic, copy) PMTweenDidUpdateBlock updateBlockDeclared In
PMTweenGroup.hInstance Methods
addTween:
Adds an object which conforms to the PMTweening protocol to the tweening group.
- (void)addTween:(NSObject<PMTweening> *)tweenParameters
- tween
An object which adopts the
PMTweeningprotocol.@remarks All tween objects added via this method will have their
updateWithTimeInterval:currentTime:method called by the PMTweenGroup instance.
Discussion
Warning: A NSInternalInconsistencyException will be raised if the provided object does not adopt the PMTweening protocol.
Declared In
PMTweenGroup.haddTween:useTweenTempo:
Adds an object which conforms to the PMTweening protocol to the tweening group.
- (void)addTween:(NSObject<PMTweening> *)tween useTweenTempo:(BOOL)useTweenTempoParameters
- tween
An object which adopts the
PMTweeningprotocol.
- useTweenTempo
When
YES, the tween object should use its own tempo to update its tween progress, and thus theupdateWithTimeInterval:currentTime:method will not be called on the object by the PMTweenGroup instance.
Discussion
Warning: A NSInternalInconsistencyException will be raised if the provided object does not adopt the PMTweening protocol.
Declared In
PMTweenGroup.haddTweens:
Adds an array of objects which should conform to the PMTweening protocol to the tweening group.
- (void)addTweens:(NSArray *)tweensParameters
- tweens
An array of objects which should conform to the
PMTweeningprotocol.@remarks All tween objects added via this method will have their
updateWithTimeInterval:currentTime:method called by the PMTweenGroup instance.
Discussion
Warning: A NSInternalInconsistencyException will be raised if the provided array contains an object which does not adopt the PMTweening protocol.
Declared In
PMTweenGroup.hinitWithTweens:options:
Initializes a new PMTweenGroup object and registers the provided array of tween objects.
- (instancetype)initWithTweens:(NSArray *)tweens options:(PMTweenOptions)optionsParameters
- tweens
An array of objects which should conform to the
PMTweeningprotocol.
- options
A bitmask of
PMTweenOptionsconfiguration values.
Return Value
A new instance of this class.
Discussion
Warning: A NSInternalInconsistencyException will be raised if the provided array contains an object which does not adopt the PMTweening protocol.
Declared In
PMTweenGroup.hisReversing
A Boolean which determines whether a tween operation, when it has tweened to the ending value, should tween from the ending value back to the starting value.
- (BOOL)isReversingDiscussion
@remarks When set to YES, the tween plays in reverse after completing a forward tween. In this state, a tween cycle represents the combination of the forward and back tweens. The default value is NO.
Declared In
PMTweening.hpauseTween
Pauses a tween that is currently tweening. (required)
- (void)pauseTweenDiscussion
@remarks When this method is called, a tween should only enter a paused state if it is currently tweening.
Declared In
PMTweening.hremoveTween:
Removes the specified tween object from the tweening group.
- (void)removeTween:(NSObject<PMTweening> *)tweenParameters
- tween
The tween object to remove.
Declared In
PMTweenGroup.hresumeTween
Resumes a tween that is currently paused. (required)
- (void)resumeTweenDiscussion
@remarks When this method is called, a tween should only resume tweening if it is currently paused.
Declared In
PMTweening.hsetReversing:
A Boolean which determines whether a tween operation, when it has tweened to the ending value, should tween from the ending value back to the starting value.
- (void)setReversing:(BOOL)reversingDiscussion
@remarks When set to YES, the tween plays in reverse after completing a forward tween. In this state, a tween cycle represents the combination of the forward and back tweens. The default value is NO.
Declared In
PMTweening.hsetTempo:
A concrete PMTweenTempo subclass that provides an update “beat” while a tween operation occurs.
- (void)setTempo:(PMTweenTempo *)tempoDiscussion
@remarks While you don’t have to implement PMTweenTempo for your own class updating, other tween collection classes like PMTweenGroup will try to remove any tempos of tween objects added to them.
Declared In
PMTweening.hstartTween
Starts a tween that is currently stopped. (required)
- (void)startTweenDiscussion
@remarks When this method is called, a tween should only start tweening if it is stopped.
Declared In
PMTweening.hstopTween
Stops a tween that is currently tweening. (required)
- (void)stopTweenDiscussion
@remarks When this method is called, a tween should only enter a stopped state if it currently tweening.
Declared In
PMTweening.htempo
A concrete PMTweenTempo subclass that provides an update “beat” while a tween operation occurs.
- (PMTweenTempo *)tempoDiscussion
@remarks While you don’t have to implement PMTweenTempo for your own class updating, other tween collection classes like PMTweenGroup will try to remove any tempos of tween objects added to them.
Declared In
PMTweening.htempoBeatWithTimestamp:
Sends an update beat that should prompt tweening classes to recalculate tween values.
- (void)tempoBeatWithTimestamp:(NSTimeInterval)timestampParameters
- timestamp
A timestamp with the current time, by which tween classes can calculate new tween values.
Declared In
PMTweenTempo.h