rx.controlEvent(.editingChanged)输入中文调用2次的问题

使用rx.controlEvent(.editingChanged)过程中,输入中文, action一直调2次,一定要记得判断textField.markedTextRange == nil

    searchTextField.rx.controlEvent(.editingChanged)
        .subscribeOn(MainScheduler.instance)
        .subscribe(onNext: { [weak self] _ in
           self?.action() 
        })
        .disposed(by: bag)

func action() { }

你可能感兴趣的:(rx.controlEvent(.editingChanged)输入中文调用2次的问题)