<!--
{
  "documentType" : "article",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Previews-deprecated",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Deprecated"
}
-->

# Deprecated

Review deprecated preview symbols and their replacements.

## Topics

### Defining a preview

[`protocol PreviewProvider`](/documentation/SwiftUI/PreviewProvider)

A type that produces view previews in Xcode.

[`enum PreviewPlatform`](/documentation/SwiftUI/PreviewPlatform)

Platforms that can run the preview.

[`func previewDisplayName(String?) -> some View`](/documentation/SwiftUI/View/previewDisplayName(_:))

Sets a user visible name to show in the canvas for a preview.

### Customizing a preview

[`func previewDevice(PreviewDevice?) -> some View`](/documentation/SwiftUI/View/previewDevice(_:))

Overrides the device for a preview.

[`struct PreviewDevice`](/documentation/SwiftUI/PreviewDevice)

A simulator device that runs a preview.

[`func previewLayout(PreviewLayout) -> some View`](/documentation/SwiftUI/View/previewLayout(_:))

Overrides the size of the container for the preview.

[`func previewInterfaceOrientation(InterfaceOrientation) -> some View`](/documentation/SwiftUI/View/previewInterfaceOrientation(_:))

Overrides the orientation of the preview.

[`struct InterfaceOrientation`](/documentation/SwiftUI/InterfaceOrientation)

The orientation of the interface from the user’s perspective.

### Setting a context

[`func previewContext<C>(C) -> some View`](/documentation/SwiftUI/View/previewContext(_:))

Declares a context for the preview.

[`protocol PreviewContext`](/documentation/SwiftUI/PreviewContext)

A context type for use with a preview.

[`protocol PreviewContextKey`](/documentation/SwiftUI/PreviewContextKey)

A key type for a preview context.



---

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)