-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Very basic TextField/TextView two way binding to viewModel #3093
Comments
Swift does not have macro or KVC in objects, so there is no binding magic like P.S. You may need |
In ReactiveCocoa 5.0, primitives like
Although we do not have a bidirectional binding system in ReactiveCocoa yet, the above snippet would work without an infinite feedback loop. This only works for bindings with controls though. Bidirectional bindings between properties, if you ever need it, are impossible without a mediator in between. |
@andersio I’ve seen that you started the work on support for bidirectional bindings on |
I have a
textfield
and atextView
in myUIViewController
and in myViewModel
I have twoString
variable, I want to bind thetextField
to variabletitle
and thetextView
to variabletextBody
. In RAC2 it's straight forward with RAC but what about RAC4 and Swift2 ?I found this in StackOverFlow :
but I get
Use of undeclared type 'NoError'
so I changed it toNSError
but now I get :Binary operator '<~' cannot be applied to operands of type 'String' and 'SignalProducer<Int?, NSError>' (aka 'SignalProducer<Optional<Int>, NSError>')
self.viewModel.title
is a simplevar title = ""
I know that I can do that :
but why all that code to just bind and the use of
startWithNext
and[weak self]
:(The text was updated successfully, but these errors were encountered: