Skip to content

can I rebind the ref property? #3

@hpsoar

Description

@hpsoar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions