我想将UITextField的里面的text直接绑定到ViewModel的username属性上。但是怎么都不行
viewModel.username <~ usernameTextField.reactive.textValues
username是String类型。<~ 的左右两边类型不对,但是我试了很多属性了,都不行,请问一下问题在哪里啊?
天蓬老师2017-04-18 09:57:14
username should be a property in RAC
such as:
var username: MutableProperty<String?> = MutableProperty<String?>(nil)
//some code
username <~ usernameTextField.reactive.textValues
That’s it
For the value binding of RAC5, you can read the official documentation: https://github.com/ReactiveCo...