---
title: "contains(_:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkmaprect/contains(_:)-1z5oa"
---

# contains(_:)

Returns a Boolean value that indicates whether one rectangle contains another.

## Declaration

```swift
func contains(_ rect2: MKMapRect) -> Bool
```

## Parameters

- `rect2`: The rectangle that rect1 might contain.

## Return Value

Return Value true if rect2 is null or lies entirely inside rect1; otherwise, returns false if rect1 is null or doesn’t completely enclose rect2.

## See Also

### Intersecting the rectangle

- [contains(_:)](mapkit/mkmaprect/contains(_:)-79tjt.md)
- [intersects(_:)](mapkit/mkmaprect/intersects(_:).md)
