Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Delegate method webViewWebContentProcessDidTerminate #354

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Installation (iOS & OSX)
Add this to your [podfile](https://guides.cocoapods.org/using/getting-started.html) and run `pod install` to install:

```ruby
`pod 'WebViewJavascriptBridge', '~> 5.0'`
pod 'WebViewJavascriptBridge', '~> 6.0'
```

### Manual installation
Expand Down
9 changes: 9 additions & 0 deletions WebViewJavascriptBridge/WKWebViewJavascriptBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,15 @@ - (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation
}
}

- (void)webViewWebContentProcessDidTerminate:(WKWebView *)webView {
if (webView != _webView) { return; }

__strong typeof(_webViewDelegate) strongDelegate = _webViewDelegate;
if (strongDelegate && [strongDelegate respondsToSelector:@selector(webViewWebContentProcessDidTerminate:)]) {
[strongDelegate webViewWebContentProcessDidTerminate:webView];
}
}

- (NSString*) _evaluateJavascript:(NSString*)javascriptCommand {
[_webView evaluateJavaScript:javascriptCommand completionHandler:nil];
return NULL;
Expand Down