No More Custom Browser Views in iOS Apps

September 14, 2015

We are on the verge of the release of iOS 9. Some of the new iOS features I like very much are related to viewing web content inside apps. I am not talking so much about apps that are built primarily with web technology, but about apps that link to web pages. For instance when you open a web link inside Twitter for iOS. Back in the days, we would use UIWebview and build our own browser view, which generally was a bad idea. Not only was UIWebView performance subpar, the layout of these custom built web browser screens was always different which confused users.

Why were custom browser views used in the first place?

The main reason why developers build their own in-app browser views, is to not have the user completely leave their app and forget to switch back. This was and still is a legitimate concern. UIWebview would display the web content, but app developers had to build the whole interface around it. Besides a back button to the app, sometimes developers would build a back and forward button for navigating between web pages if users were lucky. You maybe would see the url and see if HTTPS was used, but most of the time not. The biggest drawback would be that UIWebview was running in its own process wit no access to Safari information. So the user had no access to bookmarks or cookies. This meant that credentials that were saved in cookies were not available, requiring users to login again. Overall this rendered a bad user experience.

back button iOS 9

Enter the Back Button with iOS 9

With iOS 9, the operating system is smart enough to remember what app you used before you switched to another app. So if your iOS app opens a web url, Safari is opened with a back button. In the left hand top corner a small button is added, with the title Back to <AppName>. So a user can view the web page, do everything she does normally inside of a browser like navigating back-forward, bookmark etcetera. And when the user is done, she can just tap the back button and go back to your app. This is similar to the back button in Android, that has been there for a while and is available on operating system level. And with better and faster app switching it is no nuisance anymore to switch between apps.

SFSafariViewController for a little more customization

For developers that want a little bit more control there is the SFSafariViewController. With this class you can create a web view that looks and works 95 % like Safari. It is the responsibility of the developer to show and hide the view. But after that, it is Safari. So URL is visible, bookmarking functionality is there. Cookies are available.

Better web browsing user experience with iOS 9

I love the new features in iOS 9. Hopefully lots of developers will start using these features and ditch custom UIWebview based browsing.

Quip is apparently ready to switch over:

Dirk de Kok

Posts