RAMAN RANA RAMAN RANA - 1 year ago 129
iOS Question

How can I load a local HTML file into the UIWebView?

How can we load our own html file into the UIWebView?

Answer Source

The following code will load an HTML file named index.html in your project folder:

[WebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]];