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

body

The content and behavior of the app. そのアプリの内容と挙動。

Declaration 宣言

var body: Self.Body { get }

Discussion 議論

For any app that you create, provide a computed body property that defines your app’s scenes, which are instances that conform to the Scene protocol. For example, you can create a simple app with a single scene containing a single view:


@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            Text("Hello, world!")
        }
    }
}

Swift infers the app’s Body associated type based on the scene provided by the body property.

See Also 参照

Implementing an App アプリを実装する