---
title: "insetBy(dx:dy:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkmaprect/insetby(dx:dy:)"
---

# insetBy(dx:dy:)

Returns the specified rectangle with an inset by the specified amounts.

## Declaration

```swift
func insetBy(dx: Double, dy: Double) -> MKMapRect
```

## Parameters

- `dx`: The amount (in map points) to subtract from both sides along the x-axis.
- `dy`: The amount (in map points) to subtract from both sides along the x-axis.

## Return Value

Return Value The inset rectangle. If the original rectangle was null, that rectangle is returned instead.

## See Also

### Modifying the rectangle

- [union(_:)](mapkit/mkmaprect/union(_:).md)
- [intersection(_:)](mapkit/mkmaprect/intersection(_:).md)
- [offsetBy(dx:dy:)](mapkit/mkmaprect/offsetby(dx:dy:).md)
- [MKMapRectDivide(_:_:_:_:_:)](mapkit/mkmaprectdivide(_:_:_:_:_:).md)
