init(initialValue:)
Creates the published instance with an initial value.
Declaration
init(initialValue: Value)Parameters
- initialValue:
The publisher’s initial value.
Discussion
Don’t use this initializer directly. Instead, create a property with the @Published attribute, as shown here:
@Published var lastUpdated: Date = Date()