Instance Method

dispatchEventOfType:canBubble:cancellable:extraInfo:completion:

Dispatches an event of a specific type to the JavaScript file.

Declaration

- (void)dispatchEventOfType:(TVElementEventType)type canBubble:(BOOL)canBubble cancellable:(BOOL)isCancellable extraInfo:(NSDictionary<NSString *,id> *)extraInfo completion:(void (^)(BOOL isDispatched, BOOL isCancelled))completion;

Parameters

type

The type of TV element to dispatch. For possible values see TVElementEventType.

canBubble

A flag that indicates an event is dispatched on the target’s parent nodes after the event has been dispatched on the target.

isCancellable

A flag to indicate whether the event can be cancelled.

extraInfo

Extra properties that need to be exposed in the event object.

completion

A block object to be executed when the dispatch call is complete. This block has no return value and takes two Boolean arguments that indicate whether or not the event has been dispatched and whether it was canceled. This parameter may be NULL.

Discussion

Use this method to dispatch events from views and view controllers to JavaScript.

See Also

Dispatching Events

TVElementEventType

The type of event that has been dispatched.