• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to present a web view while supporting 10.9?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to present a web view while supporting 10.9?


  • Subject: How to present a web view while supporting 10.9?
  • From: John Brownie via Cocoa-dev <email@hidden>
  • Date: Thu, 6 Feb 2020 18:47:36 +0200

My app currently supports 10.9, and I want to add a feature that displays an HTML document stored locally (in the bundle). The obvious way is to have a window which contains a web view. However, WKWebView is only available in 10.10, and WebView is deprecated.

If it were a matter of calling a method, I could wrap it with availability calls, but it's a definition of the class of an element in a window controller class. Presumably there is a way to handle this, but I haven't discovered it.

What I'm looking for is something like

if #available(macOS 10.10, *) {
    var webView: WKWebView
}
else {
    var webView: WebView
}

...but that is for running code, not declarations.

Is there a way to do this through IB? Or is my alternative to build the window in code, using whatever is available based on the runtime platform?

John
--
John Brownie
Mussau-Emira language, New Ireland Province, Papua New Guinea
Kouvola, Finland
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Calling AVPlayer seekToTime: results in incorrect scrollWheel behavior
  • Next by Date: Is it necessary to suspend/resume a dispatch queue/source on sleep/wake notifications?
  • Previous by thread: Calling AVPlayer seekToTime: results in incorrect scrollWheel behavior
  • Next by thread: Is it necessary to suspend/resume a dispatch queue/source on sleep/wake notifications?
  • Index(es):
    • Date
    • Thread