PMTweenSequence Class Reference
| Inherits from | NSObject |
| Conforms to | PMTweenTempoDelegate PMTweening |
| Declared in | PMTweenSequence.h PMTweenSequence.m |
Overview
PMTweenSequence allows objects which conform to the PMTweening protocol to be chained together in a sequential series of tween steps.
Tasks
Creating an Instance
Setting Up a Sequence
-
– addSequenceStep:useTweenTempo: -
– removeSequenceStep: -
– currentSequenceStep -
delayproperty -
repeatingproperty -
numberOfRepeatsproperty -
reversingModeproperty
Tween State
-
sequenceStepsproperty -
tweenStateproperty -
tweenDirectionproperty -
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
PMTweenSequence.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
PMTweenSequence.hdelay
The delay, in seconds, before a sequence begins.
@property (nonatomic, assign) NSTimeInterval delayDiscussion
Warning: Setting this parameter after a sequence has begun has no effect.
Declared In
PMTweenSequence.hnumberOfRepeats
The number of tween cycle operations to repeat.
@property (nonatomic, assign) NSUInteger numberOfRepeatsDiscussion
@remarks This property is only used when the sequence’s repeating property is set to YES. Negative values are clamped to 0. The default value is 0.
See Also
Declared In
PMTweenSequence.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
PMTweenSequence.hrepeatCycleBlock
This notification block is executed when a tween cycle has completed.
@property (nonatomic, copy) PMTweenDidRepeatBlock repeatCycleBlockDeclared In
PMTweenSequence.hrepeating
A Boolean which determines whether a tween operation should repeat.
@property (nonatomic, assign) BOOL repeatingDiscussion
@remarks When set to YES, the tween operation repeats for the number of times specified by the numberOfRepeats property. The default value is NO.
See Also
Declared In
PMTweenSequence.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
PMTweenSequence.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
PMTweenSequence.hreversingMode
The mode which defines a sequence’s behavior when its reversing property is set to YES.
@property (nonatomic, assign) PMTweenSequenceReversingMode reversingModeDiscussion
@remarks The default value is PMTweenSequenceReversingNoncontiguous.
Declared In
PMTweenSequence.hsequenceSteps
An array comprising tween objects which are controlled by this PMTweenSequence object. (read-only)
@property (readonly, nonatomic, strong) NSArray *sequenceStepsDiscussion
@remarks The order of objects in this array represents the sequence order in which each will be tweened.
Declared In
PMTweenSequence.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
PMTweenSequence.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
PMTweenSequence.htweenDirection
A PMTweenDirection enum which represents the current direction of the tween operation. (read-only)
@property (readonly, nonatomic, assign) PMTweenDirection tweenDirectionDeclared In
PMTweenSequence.htweenState
A PMTweenState enum which represents the current state of the tween operation. (read-only)
@property (readonly, nonatomic, assign) PMTweenState tweenStateDeclared In
PMTweenSequence.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
PMTweenSequence.hInstance Methods
addSequenceStep:useTweenTempo:
Adds a sequence step to the end of the sequence.
- (void)addSequenceStep:(NSObject<PMTweening> *)sequenceStep useTweenTempo:(BOOL)useTweenTempoParameters
- sequenceStep
An object which conforms to 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 PMTweenSequence instance.
Discussion
Warning: A NSInternalInconsistencyException will be raised if the provided object does not adopt the PMTweening protocol.
Declared In
PMTweenSequence.hcurrentSequenceStep
The sequence step which is currently tweening, or the first sequence step if this instance’s tweenState is PMTweenStateStopped.
- (NSObject<PMTweening> *)currentSequenceStepReturn Value
The current tween object.
Declared In
PMTweenSequence.hinitWithSequenceSteps:options:
Initializes a new PMTweenSequence object, and uses the provided array of tween objects as its sequence steps.
- (instancetype)initWithSequenceSteps:(NSArray *)sequenceSteps options:(PMTweenOptions)optionsParameters
- sequenceSteps
An array of objects which should conform to the
PMTweeningprotocol.
- options
A bitmask of
PMTweenOptionsconfiguration values.
Return Value
A new instance of this class.
@remarks The sequence in which the objects are tweened is defined by their order in the provided array.
Discussion
Warning: A NSInternalInconsistencyException will be raised if the provided array contains an object which does not adopt the PMTweening protocol.
Declared In
PMTweenSequence.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.hremoveSequenceStep:
Removes the specified object from the sequence.
- (void)removeSequenceStep:(NSObject<PMTweening> *)sequenceStepParameters
- sequenceStep
The sequence step to remove.
Declared In
PMTweenSequence.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