<!--
{
  "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/PreviewPlatform",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI15PreviewPlatformO"
  },
  "title" : "PreviewPlatform"
}
-->

# PreviewPlatform

Platforms that can run the preview.

```
enum PreviewPlatform
```

## Overview

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`](/documentation/SwiftUI/PreviewProvider/platform) computed property as a hint,
and specify one of the preview platforms:

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

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

## Topics

### Getting an operating system

[`case iOS`](/documentation/SwiftUI/PreviewPlatform/iOS)

Specifies iOS as the preview platform.

[`case macOS`](/documentation/SwiftUI/PreviewPlatform/macOS)

Specifies macOS as the preview platform.

[`case tvOS`](/documentation/SwiftUI/PreviewPlatform/tvOS)

Specifies tvOS as the preview platform.

[`case watchOS`](/documentation/SwiftUI/PreviewPlatform/watchOS)

Specifies watchOS as the preview platform.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Hashable`](/documentation/Swift/Hashable)

---

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)