Re: How to present a web view while supporting 10.9?


John Brownie
 

Thanks for all the tips. I have it all worked out now.

John

Jens Alfke wrote on 7/2/20 21:39:

You'll need two code paths, one that instantiates and runs a WebView, the other that instantiates and runs a WKWebView. Their APIs and functionality are not identical, so it's not just a question of "how do I get IB to instantiate the right class". Your controller code needs to be different.

I would create my own abstract view and controller class for this (MyWebView and MyWebViewController?), then have concrete subclasses of each for the old and new WebViews. Each view class instantiates the appropriate system view and makes it a subview of itself.
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland

Join cocoa@apple-dev.groups.io to automatically receive all group messages.