<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.2.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MKMapView/setCamera(_:animated:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MKMapView(im)setCamera:animated:"
  },
  "title" : "setCamera(_:animated:)"
}
-->

# setCamera(_:animated:)

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

```
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.

---

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)