Given a local URL address like index.html
Now I need to use UIWebView
to load it in iPad. I followed these steps:
Create NSURL
<
User URLWithString to append fragment to your url, like this:
*NSURL *url = [NSURL fileURLWithPath:htmlFilePath];
url = [NSURL URLWithString:[NSString stringWithFormat:@"#%@", @"yourFragmentHere"] relativeToURL:url];*
Hope it will help :)
EDIT: Swift 3 version:
var url = URL(fileURLWithPath: htmlFilePath)
url = URL(string: "#yourFragmentHere", relativeTo: url)