WKWebView crashes if user answers an incoming iMessage
(1) First Double check your layout is correct, use "Autolayout" and make sure yourconstraints are correct and you are setting the subviews correct.
Try to visually debug the layout to see if there are any strange things happening.
Debug->View Debugging->Capture View Hierarchy.
(2) From the stack trace I notice that the keyboard gets presented, and because of this, the views need to be adjusted to make place for the keyboard. It is noticeable this happens as soon as an message arrives in the stack trace.
I would also attempt to resignFirstResponder, maybe in your AppDelegate
- (void)applicationWillResignActive:(UIApplication *)application { [_wkWebView resignFirstResponder];}
(3) I have also found that there is a bug, where the WKWEbView will not resignFirstResponder.. this might be related:
Bug 167898 - [iOS] -[WKWebView becomeFirstResponder] and -[WKWebView resignFirstResponder] don’t get called when non-programmatic first responder changes happen
Maybe a workaround then would be to present another view as soon as yourapplication will resign.
- (void)applicationWillResignActive:(UIApplication *)application { // if _wkWebView is showing then hide and show other view}