Contents

ComputedProperty()

A macro that creates a computed property for an AppEntity that allows for providing a get and/or set accessor

Declaration

@attached(peer, names: prefixed(`$`), prefixed(`_`)) @attached(accessor, names: named(get), named(set)) macro ComputedProperty()

Example

struct Restaurant: AppEntity {
    var model: Menu

    @ComputedProperty
    var menuItems: [MenuItem] {
        model.menuItems
    }
}

See Also

Entity property macros