Why SwiftUI @State property can be initialized inside `init` this OTHER way:

This is documented in the proposal SE-0258 Property Wrappers:

Out-of-line initialization of properties with wrappers

A property that has a wrapper can be initialized after it is defined, either via the property itself (if the wrapper type has an init(wrappedValue:)) or via the synthesized storage property. For example:

@Lazy var x: Int // ... x = 17 // okay, treated as _x = .init(wrappedValue: 17)
3 Likes