Disable Callouts for Links with Custom Schemes in UIWebView

Hi, I'm Hwee-Boon Yar

I write, ship and sell software products. iOS/OS X app developer based in Singapore, working remotely. This is my blog.


Need to run a code review on your codebase? Hire me

You use a UIWebView in your iPhone app to display HTML content. You add clickable links that your application handle via custom schemes (foo: instead of http://), e.g. foo:somevalue so when someone taps that link, you know what it was for and act accordingly.

You test out your app and the links work great.

Unfortunately, when press and hold the link, a callout for the link appears, revealing foo:somevalue.

The solution? Add a bit of CSS to each affected link so that it looks like:


(You'll see an interesting effect when you press and hold on the link.)

Like this post? Follow me @hboon on Twitter.