私はの下にある簡単なアプリケーションでwebView
を持っています。 webViewがデータを読み込み、Webビューデリゲートのメソッドを起動するまで、UIImageView
を表示するつもりです。 Webviewはデータをロードし、デリゲートメソッドは正常と呼ばれます。しかし、私はUIImageView
のような他のビューを操作するのに問題があります。UIWebView代理人は他のビューを変更しません
ここは私のコードです。
class ViewController: UIViewController,UIWebViewDelegate {
//contains the imageView and activityWorkingIndicator
@IBOutlet weak var splash_view: UIView!
@IBOutlet var contentWebView: UIWebView!
//Contains the Webview and other views to be displayed after the splash his hidden
@IBOutlet weak var splash_view_not: UIView!
override func viewWillAppear(animated: Bool)
{
contentWebView?.scrollView.bounces = false;
contentWebView?.delegate = self
let url = NSURL(string: "http://localhost/something/");
let request = NSURLRequest(URL: url!);
contentWebView?.loadRequest(request);
}
....
func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {
if let scheme = request.URL?.scheme {
if scheme == "myRequestScheme"{
let task : String = (request.URL?.host)!;
switch task {
case "systemReady":
print("checkpoint 1");//works fine
splash_view?.hidden = true;//no effect at all
splash_view_not?.hidden = false;//no effect at all
print("checkpoint 2");//works fine
break;
default:
break
}
}
}
return true;
}
}
ここでは何が欠けていますか?
ご質問のような
使用してのObjective-CやXcodeのとは何の関係もありません。不要なタグは付けないでください。ありがとう、 – rmaddy