Inspect UIWebView with Safari

Published February 10, 2015

My friendMatthew Sinclairpointed out aneat trickrecently. When embedding a UIWebView into an app, it's often useful to be able to inspect the contents of that view.

First, go to Settings -> Advanced and turn on the "Develop menu" in Safari.

develop menu

Then, with the simulator running, go to the Develop menu and choose the simulator.


It'll open up the Safari Inspector and give you access to the UIWebView.

It's often a good idea to mix in web views into your native screens where appropriate. Web views are fast to develop and, as long as you don't need to interact with them too much, seem just like native views. This gives you a few more tools to work with them.