class SSOViewController: UIViewController, UIWebViewDelegate
{
@IBOutlet weak var ssoWebView: UIWebView!
var activityData : ActivityData!
var ssoUrl: String!
override func viewDidLoad()
{
super.viewDidLoad()
activityData = ActivityData()
ssoWebView.delegate = self
ssoWebView.loadRequest(URLRequest(url: URL(string: ssoUrl)!) )
}
override func didReceiveMemoryWarning()
{
super.didReceiveMemoryWarning()
}
func webViewDidStartLoad(_ webView: UIWebView)
{
NVActivityIndicatorView.DEFAULT_BLOCKER_SIZE = CGSize(width: 45, height: 45)
NVActivityIndicatorPresenter.sharedInstance.startAnimating(activityData)
}
func webViewDidFinishLoad(_ webView: UIWebView)
{
//NVActivityIndicatorPresenter.sharedInstance.stopAnimating()
}
func webView(_ webView: UIWebView, shouldStartLoadWith request: URLRequest, navigationType: UIWebViewNavigationType) -> Bool
{
print(request.mainDocumentURL ?? "no url")
return false
}
}
这就是我将内容加载到webview和webViewDidStartLoad方法以及webViewDidFinishLoad方法中添加的活动指标。这两种方法也没有启动。