<!--
{
  "availability" : [
    "iOS: 13.0.0 - 27.0.0",
    "iPadOS: 13.0.0 - 27.0.0",
    "macCatalyst: 13.0.0 - 27.0.0",
    "macOS: 10.15.0 - 27.0.0",
    "tvOS: 13.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 6.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/PreviewProvider/platform",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15PreviewProviderP8platformAA0C8PlatformOSgvpZ"
  },
  "title" : "platform"
}
-->

# platform

The platform on which to run the provider.

```
@MainActor @preconcurrency 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`](/documentation/SwiftUI/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)