ObjectReader
public struct ObjectReader<Object, Content, Placeholder, Value> : View where Object : DynamicObject, Content : View, Placeholder : View
A container view that reads changes to an ObjectPublisher
-
Creates an instance that creates views for
ObjectPublisherchanges.Declaration
Swift
public init( _ objectPublisher: ObjectPublisher<Object>?, @ViewBuilder content: @escaping (ObjectSnapshot<Object>) -> Content ) where Value == ObjectSnapshot<Object>, Placeholder == EmptyViewParameters
objectPublisherThe
ObjectPublisherthat theObjectReaderinstance uses to create views dynamicallycontentThe view builder that receives an
Optional<ObjectSnapshot<O>>instance and creates views dynamically. -
Creates an instance that creates views for
ObjectPublisherchanges.Declaration
Swift
public init( _ objectPublisher: ObjectPublisher<Object>?, @ViewBuilder content: @escaping (ObjectSnapshot<Object>) -> Content, @ViewBuilder placeholder: @escaping () -> Placeholder ) where Value == ObjectSnapshot<Object>Parameters
objectPublisherThe
ObjectPublisherthat theObjectReaderinstance uses to create views dynamicallycontentThe view builder that receives an
Optional<ObjectSnapshot<O>>instance and creates views dynamically.placeholderThe view builder that creates a view for
nilobjects. -
Creates an instance that creates views for
ObjectPublisherchanges.Declaration
Swift
public init( _ objectPublisher: ObjectPublisher<Object>?, keyPath: KeyPath<ObjectSnapshot<Object>, Value>, @ViewBuilder content: @escaping (Value) -> Content ) where Placeholder == EmptyViewParameters
objectPublisherThe
ObjectPublisherthat theObjectReaderinstance uses to create views dynamicallykeyPathA
KeyPathfor a property in theObjectSnapshotwhose value will be sent to the viewscontentThe view builder that receives the value from the property
KeyPathand creates views dynamically. -
Creates an instance that creates views for
ObjectPublisherchanges.Declaration
Swift
public init( _ objectPublisher: ObjectPublisher<Object>?, keyPath: KeyPath<ObjectSnapshot<Object>, Value>, @ViewBuilder content: @escaping (Value) -> Content, @ViewBuilder placeholder: @escaping () -> Placeholder ) where Placeholder == EmptyViewParameters
objectPublisherThe
ObjectPublisherthat theObjectReaderinstance uses to create views dynamicallykeyPathA
KeyPathfor a property in theObjectSnapshotwhose value will be sent to the viewscontentThe view builder that receives the value from the property
KeyPathand creates views dynamically.placeholderThe view builder that creates a view for
nilobjects.
-
Declaration
Swift
public var body: some View { get }
View on GitHub
ObjectReader Structure Reference