📜  在观察值中未检测到 iboutlet 进度视图 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:10.378000             🧑  作者: Mango

代码示例1
class ViewController: UIViewController {

    private lazy var webView = WKWebView()
    private var observation: NSKeyValueObservation?

    override func viewDidLoad() {
        super.viewDidLoad()

        observation = webView.observe(\WKWebView.estimatedProgress, options: .new) { _, change in
            print("Loaded: \(change)")
        }
    }

    deinit {
        self.observation = nil
    }
}