SE-0258: Property Delegates

Discoverability could be helped in other ways that don't need to make the syntax more verbose. For example, option clicking on the attribute could inform you that it's a property delegate and link you to the implementation / doc blocks.

In my opinion, the syntax similarity to Custom Attributes is one of this feature's strong points. A couple reasons:

1: There is a clear way to pass arguments:

@UserDefault(key: "FOO_FEATURE_ENABLED", defaultValue: false)
var isFooFeatureEnabled: Bool

2: It is nearly as concise as current keyword-based solutions:

lazy var foo: Int
@Lazy var foo: Int
1 Like