A client has an iOS app that makes fairly heavy use of UiWebViews (with javascript running in them). About 50% of the logic and UI is done with WebViews, the rest is objective-c. He’s now interested in having the app ported to be a Mac app as well (because he thinks it would be good as a $2 app in the app store, when the store supports mac apps in a couple months).
Is it possible to do the things you can do in an iPhone app — such as embed the WebView, send a javascript string (stringByEvaluatingJavaScriptFromString), call back into objective-c code from javascript (shouldStartLoadWithRequest) — in a Mac app?
Can I even count on webkit being on every Mac?
The goal is to keep as much code identical between the Mac version and iPhone/iPad versions, of course. I don’t care if I have to use different APIs….I just want to make sure the basic functionality is there so we don’t have to start from scratch.
And more. The classes of the WebKit framework (it’s an entire separate public framework on the Mac) expose more of their guts to you than UIWebView does. You even get an Objective-C version of the DOM API.
No. WebKit was introduced in Mac OS X 10.2.7. Any Macs running a version of Mac OS X older than Jaguar, a version of Jaguar older than 10.2.7 that hasn’t had Safari installed separately, or the classic Mac OS will not have it.