In general, The WKWebView class is better choice when you replace the UIWebView class. However, in some cases, the SFSafariViewController can be better choice.
Better class is decided by the requirements
Which class is better? You may want to consider following:
- An app want to do something when read the web page.
- An app want to know the URL of the web page.
If your app fit to above, your app should use WKWebView. SFSafariViewController can’t do above.
Is the requirements really needed?
“My app want to do “Something” when read the page”. Is it really needed?
In some cases, An app display the login page, and received the specified URL, an app close the view. In this case, especially with the OAuth2, you can set the redirect URL to the custom URL Scheme (Deep Link), UIApplicationDelegate can respond to it. You can use SFSafariViewController in this case.
Is opening the browser really good UX?
Your app may open the Safari to create the new account. You should consider that this is not good UX. After user create the account, the user login to your service with that account. User goes and back between your app and the web browser.
I think it is better that an app display the SFSafariViewController with the sheet than switch to the external web browser Safari.