Swift 3 WebView

前端 未结 5 1826
走了就别回头了
走了就别回头了 2021-02-04 00:02

So I just updated to the new Xcode8 and Swift3 but now my web view does not work. Here is the code I used:

UIWebView.loadRequest(webVie         


        
5条回答
  •  情话喂你
    2021-02-04 00:27

    class WebView: UIViewController {

    @IBOutlet var myWebView: UIWebView!
    
    var urlValue = ""
    
    override func viewDidLoad() {
        super.viewDidLoad()
        if let url = URL (string: urlValue){
            let requestObj = URLRequest(url: url)
            _ = myWebView.loadRequest(requestObj)
        }
    }
    

    }

提交回复
热议问题