SPDelayedInvocation Class Reference
| Inherits from | SPEventDispatcher : NSObject |
| Conforms to | SPAnimatable |
| Declared in | SPDelayedInvocation.h |
Overview
An SPDelayedInvocation can be used to execute code at some time in the future.
It can work in two ways: first, as a proxy object that will forward any method invocations to a certain target. Second, it can simply execute an Objective-C block. Either way, the provided code is executed with a given delay.
The easiest way to delay an invocation is by calling [SPJuggler delayInvocationAtTarget:byTime:]. This method will create a delayed invocation for you, adding it to the juggler right away.
SPDelayedCall dispatches an Event of type SPEventTypeRemoveFromJuggler when it is finished,
so that the juggler automatically removes it when it’s no longer needed.
Tasks
Initialization
-
– initWithTarget:delay:block:Initializes a delayed invocation using both a target and a block. The instance will act as a proxy object, forwarding method calls to the target after a certain time has passed; the block will be invoked at the same time. Designated Initializer.
-
– initWithTarget:delay:Initializes a delayed invocation by acting as a proxy object forwarding method calls to the target after a certain time has passed.
-
– initWithDelay:block:Initializes the delayed invocation of a block.
-
+ invocationWithTarget:delay:Factory method.
-
+ invocationWithDelay:block:Factory method.
Properties
-
targetThe target object to which messages will be forwarded.
property -
totalTimeThe time messages will be delayed (in seconds).
property -
currentTimeThe time that has already passed (in seconds).
property -
isCompleteIndicates if the total time has passed and the invocations have been executed.
property
Properties
currentTime
The time that has already passed (in seconds).
@property (nonatomic, assign) double currentTimeDiscussion
The time that has already passed (in seconds).
Declared In
SPDelayedInvocation.hisComplete
Indicates if the total time has passed and the invocations have been executed.
@property (nonatomic, readonly) BOOL isCompleteDiscussion
Indicates if the total time has passed and the invocations have been executed.
Declared In
SPDelayedInvocation.hClass Methods
Instance Methods
initWithDelay:block:
Initializes the delayed invocation of a block.
- (instancetype)initWithDelay:(double)time block:(SPCallbackBlock)blockDiscussion
Initializes the delayed invocation of a block.
Declared In
SPDelayedInvocation.hinitWithTarget:delay:
Initializes a delayed invocation by acting as a proxy object forwarding method calls to the target after a certain time has passed.
- (instancetype)initWithTarget:(id)target delay:(double)timeDiscussion
Initializes a delayed invocation by acting as a proxy object forwarding method calls to the target after a certain time has passed.
Declared In
SPDelayedInvocation.hinitWithTarget:delay:block:
Initializes a delayed invocation using both a target and a block. The instance will act as a proxy object, forwarding method calls to the target after a certain time has passed; the block will be invoked at the same time. Designated Initializer.
- (instancetype)initWithTarget:(id)target delay:(double)time block:(SPCallbackBlock)blockDiscussion
Initializes a delayed invocation using both a target and a block. The instance will act as a proxy object, forwarding method calls to the target after a certain time has passed; the block will be invoked at the same time. Designated Initializer.
Declared In
SPDelayedInvocation.h