I've an app/project with deployment target version - iOS 10.
I had used UIWebView
, which is deprecated now and replaced by WKWebView
. So, I want to replace UIWebView with WKWebView in my project also.
It force me to either use UIWebView
(with iOS 10) or change deployment target to iOS 11.
I cannot change deployment target but as a middleware solution, I added code (programatically) support for both. I mean, if user's device OS is iOS 11 (or above) then use WKWebView
else use UIWebView
(for iOS 10 or below).
Issue statement: Storyboard's view controller does not support both versions, I mean, in storyboard, if I set View controller's deployment target to iOS 11 then app crashes in iOS 10 (and obvious it should) and if I set view controller's deployment target to iOS 10, then storyboard does not allow me to build project.
For iOS 10, WKWebView
shows me this error: Xcode 9 GM - WKWebView NSCoding support was broken in previous versions
Question: How can I make storyboard (View controller) to use WKWebView
for iOS 11 and UIWebView
for iOS 10? Is there any configuration setup or option in story board (view controller) that can allow me to add both interface outlets?
viewDidLoad
with aWKWebView
. – DonMag