---
title: "setCamera(_:animated:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkmapview/setcamera(_:animated:)"
---

# setCamera(_:animated:)

Changes the camera to use for determining the map’s viewing parameters, and optionally animates the change.

## Declaration

```swift
func setCamera(_ camera: MKMapCamera, animated: Bool)
```

## Parameters

- `camera`: The camera object containing the viewing angle information. This parameter can’t be nil.
- `animated`: Specify doc://com.apple.documentation/documentation/Swift/true if you want the map view to animate the change in viewing angle, or doc://com.apple.documentation/documentation/Swift/false if you want the map to reflect the changes without animations.

## See Also

### Configuring the map display

- [camera](mapkit/mkmapview/camera.md)
- [showsCompass](mapkit/mkmapview/showscompass.md)
- [showsPitchControl](mapkit/mkmapview/showspitchcontrol.md)
- [showsScale](mapkit/mkmapview/showsscale.md)
- [showsZoomControls](mapkit/mkmapview/showszoomcontrols.md)
- [showsBuildings](mapkit/mkmapview/showsbuildings.md)
- [showsPointsOfInterest](mapkit/mkmapview/showspointsofinterest.md)
- [pointOfInterestFilter](mapkit/mkmapview/pointofinterestfilter.md)
- [showsTraffic](mapkit/mkmapview/showstraffic.md)
