Last active
November 25, 2020 02:30
-
-
Save growvv/6cc719df5368f8d3bfe4248220eb4f28 to your computer and use it in GitHub Desktop.
制作一个页面:通过url请求
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
class MoreViewController: UIViewController { | |
@IBOutlet var webView: UIWebView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
setupUI() | |
let url: URL = URL(string: "https://github.com/arslanbilal")! | |
webView.loadRequest(URLRequest(url: url)) | |
} | |
} | |
extension MoreViewController { | |
func setupUI() { | |
view.backgroundColor = .white | |
} | |
} |
extension用的非常妙啊,就不用把一堆函数都写到一个类里
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@IBOutlet用来引用storyboard中的界面元素