Long rant coming up!
Web views sometimes are crucial. For example in one of my apps, an RSS reader, a fundamental part of such an app is to show the actual content of an RSS news item. This is normally in the form of HTML, but not an HTML page you can visit on the net but an HTML string meant to show as a preview (some feeds include the whole article, some just a preview) of the actual web site article. Without *WebView this would be a hopeless task since it would mean you'd have to include the full code for a web browser in your app.
So you definitely want to have view which can be loaded with some random HTML code.
However, once a user press a link in this preview (or click to read the actual article on the web), now you want to use a standard browser, not an app-controlled *WebView. But when you do this in e.g. Facebook's app, you end up in a *WebView of FB's design -> they can check exactly what you do, your browser plugins won't work, keychain entries won't work, etc. And this sucks. The proper solution is either to immediately kick the user to Safari (in FB this takes some extra clicks), or use the SFSafariView which iOS provides which is essentially the complete Safari app running internally in the app: Plugins work, keychain works, and the developer has no way of knowing what's going on or what the user does (the only thing one can do with this view it to tell it to open with a given URL). This is what I do in my app, but I'm not the least interested in selling ads, checking what a user does, and so on.
I could allow a click to send you to the Safari app but on iOS that is actually a horrible UI since this would mean you'd have to jump back and forth between Safari & the RSS app all the time, so an internal Safari makes complete sense. I've gotten loads of requests for the app, but 0 about opening links in Safari since it's so obviously a bad idea, UI-wise.
IOW & IMHO:
- Use WKWebView when you for certain reasons have HTML which is not just a wrapper of an actual web page
- Use SFSafariView (or the actual Safari app) when you need to show an actual web page
Especially SFSafariView is missing in a lot of discussions about web views on iOS I've seen. I suspect this is because many apps think they need to know what the user is up to and track their doings, for advertising purposes or other things.
Web views sometimes are crucial. For example in one of my apps, an RSS reader, a fundamental part of such an app is to show the actual content of an RSS news item. This is normally in the form of HTML, but not an HTML page you can visit on the net but an HTML string meant to show as a preview (some feeds include the whole article, some just a preview) of the actual web site article. Without *WebView this would be a hopeless task since it would mean you'd have to include the full code for a web browser in your app.
So you definitely want to have view which can be loaded with some random HTML code.
However, once a user press a link in this preview (or click to read the actual article on the web), now you want to use a standard browser, not an app-controlled *WebView. But when you do this in e.g. Facebook's app, you end up in a *WebView of FB's design -> they can check exactly what you do, your browser plugins won't work, keychain entries won't work, etc. And this sucks. The proper solution is either to immediately kick the user to Safari (in FB this takes some extra clicks), or use the SFSafariView which iOS provides which is essentially the complete Safari app running internally in the app: Plugins work, keychain works, and the developer has no way of knowing what's going on or what the user does (the only thing one can do with this view it to tell it to open with a given URL). This is what I do in my app, but I'm not the least interested in selling ads, checking what a user does, and so on.
I could allow a click to send you to the Safari app but on iOS that is actually a horrible UI since this would mean you'd have to jump back and forth between Safari & the RSS app all the time, so an internal Safari makes complete sense. I've gotten loads of requests for the app, but 0 about opening links in Safari since it's so obviously a bad idea, UI-wise.
IOW & IMHO:
- Use WKWebView when you for certain reasons have HTML which is not just a wrapper of an actual web page
- Use SFSafariView (or the actual Safari app) when you need to show an actual web page
Especially SFSafariView is missing in a lot of discussions about web views on iOS I've seen. I suspect this is because many apps think they need to know what the user is up to and track their doings, for advertising purposes or other things.