webview访问URL

//    // Do any additional setup after loading the view.

//    //创建WKWebView

//    WKWebView *web = [[WKWebView alloc] initWithFrame:[UIScreen mainScreen].bounds];

//    // 设置访问的URL

//    NSURL *url = [NSURL URLWithString:@"http://www.jianshu.com"];

//    // 根据URL创建请求

//    NSURLRequest *request = [NSURLRequest requestWithURL:url];

//    // WKWebView加载请求

//    [web loadRequest:request];

//    // 将WKWebView添加到视图

//    [self.contentView addSubview:web];

原文地址:https://www.cnblogs.com/gloryhope/p/13055223.html