I was wondering how I can override the UIActionSheet that appears when tapping and holding your finger on a link in an UIWebView (it shows the link and an open and copy button). I need to add a button to the alert, but I don’t know how to customize it.
Does anyone have an idea on how to solve this?
Given that there exists no such API, you still could customize the sheet in a non-standard-api-like-way without using private api. The easiest will probably be to observe the subviews of that webview and when one appears (like a popup) check it’s class and if it’s such a popup, to customize it. Here’s how I’d try that.
Still: this is hacky and might easily break in the next update.
Add observation:
Then observe:
Then do your customization in such a method: