Skip to content

Instantly share code, notes, and snippets.

@jamespeerless
Created August 4, 2014 15:16
Show Gist options
  • Save jamespeerless/4dc7cdecf984d5195753 to your computer and use it in GitHub Desktop.
Save jamespeerless/4dc7cdecf984d5195753 to your computer and use it in GitHub Desktop.
_pageJSContext[@"sendRequest"] = ^(NSString *eventName, NSString *payload) {
__strong DNTBrowserViewController *strongSelf = weakSelf;
DDLogDebug(@"CS -> KEY-OVERLAY: %@", eventName);
// pass message from webview to keyboard overlay context
if (strongSelf.keyboardOverlayWebViewController.overlayJSContext)
{
JSValue *jsOnRequest = strongSelf.keyboardOverlayWebViewController.overlayJSContext[@"onRequest"];
[jsOnRequest callWithArguments:@[eventName, payload]];
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment