Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If you use the properties implemented in RxWebKit together with the properties implemented in RxCocoa, it will crash. #52

Open
keisukeYamagishi opened this issue Oct 28, 2021 · 0 comments · May be fixed by #56
Labels

Comments

@keisukeYamagishi
Copy link
Member

Please check to the following log for the runtime.

2021-10-28 19:14:34.228664+0900 RxWebKitSample[2594:65726] RxCocoa/RxCocoa.swift:153: Fatal error: Failure converting from Optional(<RxCocoa.RxWKNavigationDelegateProxy: 0x600003ec4900>) to RxWKNavigationDelegateProxy
(lldb) 

The sample code is attached below.

import UIKit
import RxSwift
import RxCocoa
import RxWebKit
import WebKit

class ViewController: UIViewController {

    @IBOutlet weak var webView: WKWebView!
    let disposeBag = DisposeBag()

    override func viewDidLoad() {
        super.viewDidLoad()
        
        webView.load(URLRequest(url: URL(string: "https://google.com")!))
        
        webView.rx
            .didStartLoad // <- This property is implementing at the RxCocoa
            .subscribe { value in
                print("value: \(value)")
            }.disposed(by: disposeBag)
        
        webView.rx
            .didStartProvisionalNavigation // <- This property is implementing at the RxWebKit
            .asObservable()
            .subscribe { (webView: WKWebView, navigation: WKNavigation) in
                print("web: \(webView)")
                print("navigation: \(navigation)")
            }.disposed(by: disposeBag)
        // Do any additional setup after loading the view.
    }
}

The image of the runtime is attached below.

Screen Shot 2021-10-28 at 19 22 41

Error log bellow

Thread 1: Fatal error: Failure converting from Optional(<RxCocoa.RxWKNavigationDelegateProxy: 0x600003ec4900>) to RxWKNavigationDelegateProxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant