Type Property 型プロパティ

platform

The platform on which to run the provider. それの上でプロバイダを走らせることになるプラットホーム。

Declaration 宣言

static var platform: PreviewPlatform? { get }

Discussion 議論

Xcode infers the platform for a preview based on the currently selected target. If you have a multiplatform target and want to suggest a particular target for a preview, implement the platform computed property to provide a hint, and specify one of the PreviewPlatform values:


struct CircleImage_Previews: PreviewProvider {
    static var previews: some View {
        CircleImage()
    }


    static var platform: PreviewPlatform? {
        PreviewPlatform.tvOS
    }
}

Xcode ignores this value unless you have a multiplatform target.

Default Implementations 省略時実装

PreviewProvider Implementations