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

# setCameraBoundary(_:animated:)

Sets the camera boundary for the map view, specifying whether to use animation.

## Declaration

```swift
func setCameraBoundary(_ cameraBoundary: MKMapView.CameraBoundary?, animated: Bool)
```

## Parameters

- `cameraBoundary`: The new doc://com.apple.mapkit/documentation/MapKit/MKMapView/CameraBoundary-swift.class.
- `animated`: A Boolean value that indicates whether the framework animates the transition of the map view to the new boundary.

## See Also

### Constraining the map view

- [cameraBoundary](mapkit/mkmapview/cameraboundary-swift.property.md)
- [setCameraZoomRange(_:animated:)](mapkit/mkmapview/setcamerazoomrange(_:animated:).md)
- [cameraZoomRange](mapkit/mkmapview/camerazoomrange-swift.property.md)
- [MKMapView.CameraBoundary](mapkit/mkmapview/cameraboundary-swift.class.md)
- [MKMapView.CameraZoomRange](mapkit/mkmapview/camerazoomrange-swift.class.md)
