Closed AttilaTheFun closed 6 years ago
@AttilaTheFun change the code to look like this and try again
class TestViewController {
var webView: WKWebView!
let bag = DisposeBag()
func viewDidLoad() {
super.viewDidLoad()
self.webView = WKWebView(frame: self.view.bounds)
self.webView.rx.url.subscribe(onNext: { print($0) }).disposed(by: self.bag)
self.webView.load(URLRequest(url: URL(string: "https://github.com")!))
}
}
I'm instantiating a web view, registering to observe its url, and loading a request in my view controller's view did load. When I comment out the line subscribing to observe it, it loads fine. Any idea what could be going on?
I set a breakpoint and saw it print the first item, a nil url, but it never called it again.