Skip to content

Create new model to simplify init for fields #1732

@gemcoder21

Description

@gemcoder21
struct ViewModel {
    var openTitle: TextValue { TextValue(text: Localized.Charts.Price.open, style: Self.titleStyle, lineLimit: 1) }
    var openValue: TextValue { TextValue(text: formatter.string(double: candle.open), style: Self.subtitleStyle, lineLimit: 1) }
}


struct Viewmodel {
    var openField: Field {
        title: TextValue(text: Localized.Charts.Price.open, style: Self.titleStyle, lineLimit: 1),
        value: TextValue(text: formatter.string(double: candle.open), style: Self.subtitleStyle
    }
}

ListItemView(field: model.openField)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions