Reputation: 21
novice help, listen to people say UiWebView
can load a local html
file, I have a web application html + js
can be run from a web page and want to run into the ipad
.
if anyone knows, please express specific operation. Extremely grateful stackoverflow first post.
Upvotes: 2
Views: 260
Reputation: 675
Create a new Xcode project.
Import your html, javascript, css, etc, file(s) to your Xcode Project,
Add UIWebView to your XIB, or storyboard. (As for me, I named it as webView - see figure)
Then in the UIViewController delegate method - (void)viewDidLoad
-
(void)viewDidLoad { }
Put something like this:
NSURL *rootURL = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html"];
NSURLRequest *requestURL = [NSURLRequest requestWithURL:rootURL];
[self.webView loadRequest:requestURL];
Run your project to test. As for me, this is the result:
Upvotes: 7