Skip to content
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

can I rebind the ref property? #3

Open
hpsoar opened this issue Jun 16, 2017 · 1 comment
Open

can I rebind the ref property? #3

hpsoar opened this issue Jun 16, 2017 · 1 comment

Comments

@hpsoar
Copy link

hpsoar commented Jun 16, 2017

What if I rebind another UITextField to a Field node or another UIButton to a Button node?

Ideally, I'd like to have a layout pre-build based on model, then I may bind this layout and model to different views.

This is the usual case we deal with UITableView/UITableViewCell.

The use case may be like this:

class MyLayout: <Your Layout Base Class> {
    public var button: Button!
    public var field: Feild!

    func calculateLayout(model: <SomeModel>) {
    }
}

...

    let layout = MyLayout()   // this layout may be hold after calculation
    ...
    layout.button.bind(<some UIButton>) or layout.button.ref = <some UIButton>
    layout.feild.bind(<some UITextField>) or layout.field.ref = <some UITextField>
    ...
@s4cha
Copy link
Member

s4cha commented Dec 20, 2019

⚠️ Swift UI is out so this is now deprecated in favor of the official alternative. This will no longer be maintained. This was a fun experiment 😎. No updates will be issued unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants