Type 'inout UIButton' does not conform to protocol 'ReactiveCompatible'

passWordInputView.inputTextField.rx.controlEvent(.editingDidEnd)
        .bindTo(loginButton.rx.tap)
        .disposed(by: disposeBag)

when editing the password, then log in

but get an error: The type 'inout UIButton' does not conform to the protocol 'ReactiveCompatible'

+6
source share
1 answer

Since RxSwift contains the following line , you can be sure that something else gives the compiler problems when you get this error for any NSObject Subclass (all in UIKit).

extension NSObject: ReactiveCompatible { }

In my experience, this error occurs when trying to use rx methods or operators incorrectly or if there is a syntax error.

, View ,

Observable.merge(collectionView.rx.streamOne, streamTwo)

-

Observable.of(collectionView.rx.streamOne, streamTwo).merge()

( static Observable.merge RxSwift 3.4)


inputTextField.rx.controlEvent(.editingDidEnd), Observable<Void> loginButton.rx.tap, Observable, Observer. -, button.rx.tap .

-

inputTextField.rx.controlEvent(.editingDidEnd)
    .subscribe(onNext: { [unowned self] in
        self.inputTextField.userInteractionEnabled = false
        self.doLogin()
    }

, :)

+6

Source: https://habr.com/ru/post/1015854/


All Articles