UIWebViewClass was deprecated and we need to replace it with WKWebView or SFSafariViewController. Which class we should use?
I think we use WKWebView normally, but SFSafariViewController has enough functionality in some case.
It is decided which class can be used by requirements.
- You want to do something just before or after loading pages.
- You want to know the URL of loading pages.
If you want to do above, you need to use WKWebView. SFSafariViewController can not do above.
Requirements are really needed?
“We want to do something just after loading pages.”. It is often available requirement but it is really needed?
If you want to know the URL of loaded pages to check the authorization status, you can set the redirect URL to the application custom URL scheme and UIApplicationDelegate can handle it. It is able to do with SFSafariViewController.
Launching the browser is really good?
It is bad UX that launching Safari with sign-up page to create the account. After the account was created, user sign in in the app. User go and come between your app and Safari. It can’t be say good UX.
It is better opening the sign-up page with SFSafariViewController than launching Safari, I think.
- Representative of RK Kaihatsu. I am a professional developer specializing in macOS Apps, iOS Apps, SDKs and middleware development. I often use ObjC, Swift and C++. Based on development experience, I provide e-learning contents, technical books and technical guidance. I am also a technical seminar instructor, in-house training instructor, and administrative / local goverment staff training instructor.