ios - ReactiveCocoa5.0 绑定问题
怪我咯
怪我咯 2017-04-18 09:55:14
0
1
427

我想将UITextField的里面的text直接绑定到ViewModel的username属性上。但是怎么都不行

viewModel.username <~ usernameTextField.reactive.textValues

username是String类型。<~ 的左右两边类型不对,但是我试了很多属性了,都不行,请问一下问题在哪里啊?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
Peter_Zhu

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...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!