Instance Property インスタンスプロパティ

body

The content and behavior of the view. ビューの内容と挙動。

Declaration 宣言

var body: Self.Body { get }

Discussion 議論

When you implement a custom view, you must implement a computed body property to provide the content for your view. Return a view that’s composed of built-in views that SwiftUI provides, plus other composite views that you’ve already defined:


struct MyView: View {
    var body: some View {
        Text("Hello, World!")
    }
}

For more information about composing views and a view hierarchy, see Declaring a Custom View.

Default Implementations 省略時実装

NSViewControllerRepresentable Implementations

NSViewRepresentable Implementations

Shape Implementations Shape実装

UIViewControllerRepresentable Implementations

UIViewRepresentable Implementations

WKInterfaceObjectRepresentable Implementations

See Also 参照

Implementing a Custom View カスタムビューを実装する