Contents

init(wrappedValue:)

Creates the published instance with an initial wrapped value.

Declaration

init(wrappedValue: Value)

Parameters

  • wrappedValue:

    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()

See Also

Creating a published instance