Skip to content

Type Property

平台-platform

运行提供者的平台。

必需 提供的默认执行。

The platform on which to run the provider.

Required.Default implementation provided.

说明-Declaration

static var platform: PreviewPlatform? { get }

讨论-Discussion

如果预览提供者对这个属性返回nil,Xcode会根据定义了PreviewProvider的文件来推断平台。只有当文件在一个支持多个平台的目标中时,才返回nil。

If the preview provider returnsnilfor this property, Xcode infers the platform based on the file in which thePreviewProvideris defined. Returnnilonly when the file is in a target that supports multiple platforms.

默认实现-Default Implementations

  • PreviewProvider实现-

static var platform: PreviewPlatform?

运行供应商的平台。

The platform on which to run the provider.

平台- platform

运行提供者的平台。

The platform on which to run the provider.

说明-Declaration

static var platform: PreviewPlatform? { get }

讨论-Discussion

如果预览提供者对这个属性返回nil,Xcode会根据定义了PreviewProvider的文件来推断平台。只有当文件在一个支持多个平台的目标中时,才返回nil。

If the preview provider returnsnilfor this property, Xcode infers the platform based on the file in which thePreviewProvideris defined. Returnnilonly when the file is in a target that supports multiple platforms.