swift加载浏览器

swift加载浏览器
页面上拉个控件

 @IBOutlet weak var web: UIWebView!
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        var url = NSURL(string: "http://baidu.com");
        var request = NSURLRequest(URL: url!);
        web.loadRequest(request);
    }

纯代码实现

        var webView = UIWebView()
        webView.delegate = self
 
        var url = NSURL(string:"http://localhost//list.php")
 
        var urlRequest = NSURLRequest(URL:url!)
        webView.frame = CGRectMake(0, 20, sizewebview, posywebview)
        webView.loadRequest(urlRequest)
        self.view.addSubview(webView)


This entry was posted in Xcode and tagged , , . Bookmark the permalink.
月小升QQ 2651044202, 技术交流QQ群 178491360
首发地址:月小升博客https://java-er.com/blog/swift-load-brower/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
您的评论是我写作的动力.
2020.03.24 评论已经全局关闭,有事加QQ聊天