---
title: PreviewCamera
framework: developertoolssupport
role: symbol
role_heading: Structure
path: developertoolssupport/previewcamera
---

# PreviewCamera

A camera that defines a viewpoint in a preview.

## Declaration

```swift
struct PreviewCamera
```

## Overview

Overview Use one or more preview cameras with one of the preview macros that takes a cameras input — like Preview(_:traits:body:cameras:) — to create custom viewpoints for the preview. The canvas offers custom cameras in its camera picker along with a set of standard cameras. The preview uses the first custom camera that you specify as the default viewpoint when the preview appears. For example, you can create custom cameras from the top, leading, and front viewpoints: #Preview {     CircleImage() } cameras: {     PreviewCamera(from: .top, name: "Top")     PreviewCamera(from: .leading, name: "Leading")     PreviewCamera(from: .front, name: "Front") }

## Topics

### Creating a preview camera

- [init(from:zoom:name:)](developertoolssupport/previewcamera/init(from:zoom:name:).md)
- [init(lookingAt:from:name:)](developertoolssupport/previewcamera/init(lookingat:from:name:).md)

## Relationships

### Conforms To

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Preview camera management

- [PreviewCameraBuilder](developertoolssupport/previewcamerabuilder.md)
