Observing UITextField.editing with RxSwift

前端 未结 3 828
别那么骄傲
别那么骄傲 2021-02-04 00:13

I want to observe the property UITextfield.editing. I\'m using this code:

self.money.rx_observe(Bool.self, \"editing\").subscribeNext { (value) in
          


        
3条回答
  •  攒了一身酷
    2021-02-04 00:55

    For RXSwift 3.0

    textField.rx.controlEvent([.editingDidBegin,.editingDidEnd])
            .asObservable()
            .subscribe(onNext: {
                print("editing state changed")
            }).disposed(by: disposeBag)
    

提交回复
热议问题