GithubHelp home page GithubHelp logo

Comments (6)

andersio avatar andersio commented on April 28, 2024

DynamicProperty belongs to ReactiveCocoa, since it is Cocoa specific.

To observe KVO changes, ReactiveCocoa now provides a plain and simple NSObject.reactive.values(forKeyPath:), in addition to DynamicProperty. As for bindings, ReactiveCocoa now includes a comprehensive set of reactive extensions to AppKit and UIKit components, accessible via .reactive.

Please check https://github.com/ReactiveCocoa/ReactiveCocoa/ for more information.

from reactiveswift.

tuzaiz avatar tuzaiz commented on April 28, 2024

Thanks for @andersio answer, but how could I fix the code like this?

DynamicProperty(object: nameLabel, keyPath: "text") <~ viewModel.name.producer

from reactiveswift.

andersio avatar andersio commented on April 28, 2024

DynamicProperty is parameterized in 5.0. Specialize it with the expected type.

Alternatively, use the new reactive extensions.

DynamicProperty<String>(object: nameLabel, keyPath: "text") <~ viewModel.name.producer

nameLabel.reactive.text <~ viewModel.name.producer

from reactiveswift.

tuzaiz avatar tuzaiz commented on April 28, 2024

Yeah~ it works. Thank you!! One more question please.

How could I bind text value of textField to property?

I tried this but it shows Ambiguous reference to member 'textValues'

self.viewModel.title <~ self.titleField.reactive.textValues

from reactiveswift.

andersio avatar andersio commented on April 28, 2024

Is Value of your title non-optional? You need to deal with the optionality of textValues. You can do optional <~ (optional | non-optional), but never non-optional <~ optional.

P.S. It would be great to have Cocoa related questions in ReactiveCocoa instead. ;)

from reactiveswift.

tuzaiz avatar tuzaiz commented on April 28, 2024

Thank you @andersio , you're really a lifesaver. And sorry, I don't really realize the diff between ReactiveSwift and ReactiveCocoa, now I understand much more. :)

from reactiveswift.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.