the object to store and make available to the view’s subhierarchy.
Instance Method
インスタンスメソッド
environment
environmentObject(_:)
Supplies an
ObservableObject
to a view subhierarchy.Availability 有効性
- iOS 13.0+
- iPadOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
Technology
- Swift
UI
Declaration 宣言
func environmentObject<T>(_ object: T) -> some View
where T : ObservableObject
Parameters パラメータ
object
Discussion 議論
The object can be read by any child by using Environment
.