André Morujão André Morujão - 4 months ago 82
iOS Question

WebKit throwing exception on iOS 8 for call to setBeingRemoved:

I have an app which relies on UIWebViews for some of its screens, but starting on iOS 8 I started seeing the following exception being thrown occasionally:

WebKit discarded an uncaught exception in the webView:willRemoveScrollingLayer:withContentsLayer:forNode: delegate: <NSInvalidArgumentException> -[WebActionDisablingCALayerDelegate setBeingRemoved:]: unrecognized selector sent to instance (...)

This will normally happen in response to tapping a button or link on the webview (without anything else going on on the Objective-C side), and after that most of the functionality in the webview will be broken (links not clickable, etc).

I have seen at least one other question referring to this error message, but no conclusive answers yet.

Has anyone ran into this issue and figured out what was wrong / what causes it?
It appears to depend entirely on the HTML content, meaning that the fact that this exception is thrown is an iOS 8 bug.

Answer

Turns out this error was caused by the use of the following CSS property on an iframe in my HTML:

-webkit-overflow-scrolling: touch;

Removed it (we're now looking for a suitable alternative) and the UIWebView no longer crashes.