Instance Method

evaluate(inJavaScriptContext:completion:)

Evaluates a block in the JavaScript execution queue.

Declaration

func evaluate(inJavaScriptContext evaluation: @escaping (JSContext) -> Void, completion: ((Bool) -> Void)? = nil)

Parameters

evaluation

The block to be evaluated in the JavaScript execution queue.

completion

The callback after the block has been executed. true if the block was evaluated; false otherwise.

Discussion

This method adds a block to the JavaScript execution queue and invokes the completion block after the evaluation block has finished execution. The context block parameter is valid within the scope of the evaluation block and should not be referenced by the app outside the block.

See Also

Controlling and Handling Events

func stop()

Ends the app life cycle.