ダウンロードしたURLのNSURLRequest
を作成します。そして、あなたはloadRequest(_ request: NSURLRequest)
スウィフト2.2でのWebViewの内容を変更することができます。
let myURLString = "the url you read from the file"
let url = NSURL(string: myURLString)
let request = NSURLRequest(url)
//assuming, the property webView is the UIWebView you want to change
webView.loadRequest(request)
のObjective-C:
NSString * myURLString = @"the url you read from the file";
NSURL * url = [[NSURL alloc] initWithString:myURLString];
NSURLRequest * request = [[NSURLRequest alloc] initWithURL:url];
//assuming, the property webView ist the UIWebView you want to change
[self.webView loadRequest:request];
詳細情報:
素早く答えてくれてありがとうしかし、あなたは、Objective-Cのか、その問題でこれを書くことができますか? :) –
Objective-Cのコードを追加しました。 (私は両方のコードをテストしませんでした。ブラウザに書き込んだので、いくつかのタイプミスがあるかもしれません) – FelixSFD