Inherits from NSObject
Conforms to RCTJavaScriptExecutor
Declared in RCTWebViewExecutor.h

Overview

Uses an embedded web view merely for the purpose of being able to reuse the existing webkit debugging tools. Fulfills the role of a very constrained JSContext, which we call RCTJavaScriptExecutor.

TODO: To ensure production-identical execution, scrub the window environment. And ensure main thread operations are actually added to a queue instead of being executed immediately if already on the main thread.

Tasks

Properties

onApplicationScriptLoaded

@property (nonatomic, copy) RCTJavaScriptCompleteBlock onApplicationScriptLoaded

Instance Methods

initWithWebView:

- (instancetype)initWithWebView:(UIWebView *)webView
Discussion

Instantiate with a specific webview instance

Declared In

RCTWebViewExecutor.h

invalidateAndReclaimWebView

- (UIWebView *)invalidateAndReclaimWebView
Discussion

Invoke this to reclaim the web view for reuse. This is necessary in order to allow debuggers to remain open, when creating a new RCTWebViewExecutor. This guards against the web view being invalidated, and makes sure the delegate is cleared first.

Declared In

RCTWebViewExecutor.h