Change the model value while change the text in textfield ios swift

 Solution:

While using normal method you can use the textfield delegate methods to change the model associated value to the textfield.In RXSwift it's very easy to change that.

        cell.mytf!.rx.text.changed

            .subscribe(onNext: {

                self.model.value = ($0 ?? "").trimmingCharacters(in: .whitespaces)

            }).disposed(by: cell.disposeBag)


Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

store cgpoint in userdefaults iOS swift