I want to integrate a full HTML framework (ie HTML/CSS/JavaScript) inside an iOS app and make the UIWebView in charge of running the HTML content being able to communicate with
The way you usually talk back from JavaScript is by opening a fictional URL (by window.location
), and then implementing UIWebViewDelegate
's -webView:shouldStartLoadWithRequest:navigationType:
to ignore the navigation and handle what needs to be done instead.
(On Mac OS X WebKit, you can supply Objective-C objects that have JavaScript functions to the web site, but this is not available in iOS.)