I'm building an iOS app that has an in-app web browser.

One feature that [Tweetbot](http://tapbots.com/software/tweetbot/) includes is the ability to detect if a link will exit Tweetbot when opened. Here's a screenshot of what happens when you tap an App Store link:

![enter image description here](https://i.stack.imgur.com/lzPfL.png)

How would I go about detecting if the application is about to close as the result of opening a link?

**Update:** I suppose this question isn't being clear enough: I'm aware of the `UIWebViewDelegate` methods, and that `[[UIApplication sharedApplication] openURL:url]` bits.

What I'm trying to figure out isn't *how to open a URL* or *how to know if a web view is opening a URL* - it's about **how do I evaluate a URL to determine if it will result in leaving the application without opening the URL first?**

Am I watching for `itms://` URLs? Is there a clean and simple way to know whether a given URL will exit the application for more than just `itms://` URLs?