【发布时间】:2018-09-18 05:11:27
【问题描述】:
我用过如下:-
self.IntervalTimer = Timer.scheduledTimer(timeInterval: 3, target: self, selector: #selector(self.timeaction), userInfo: nil, repeats: true)
func timeaction(){
//code for move next VC
let myWebView:UIWebView = UIWebView(frame: CGRect(x:0, y:0, width: UIScreen.main.bounds.width, height:UIScreen.main.bounds.height))
self.view.addSubview(myWebView)
myWebView.delegate = self
//1. Load web site into my web view
let myURL = URL(string: "https://eample.com")
let myURLRequest:URLRequest = URLRequest(url: myURL!)
myWebView.loadRequest(myURLRequest)
}
但显示为错误:- Webview容器加载次数过多。如何解决问题。这里我需要在ViewController的主视图的webview中加载url。如何做?
【问题讨论】:
-
你可以将重复设置为 false 可能有效。
-
@SagarBhut 谢谢你 ....
-
成功了吗?为你。 @clydececiljohn
-
@SagarBhut 是的。它起作用了.....
标签: ios