---
title: "annotations(in:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkmapview/annotations(in:)"
---

# annotations(in:)

Returns the annotation objects within the specified map rectangle.

## Declaration

```swift
func annotations(in mapRect: MKMapRect) -> Set<AnyHashable>
```

## Parameters

- `mapRect`: The portion of the map that you want to search for annotations.

## Return Value

Return Value The set of annotation objects within mapRect.

## Discussion

Discussion This method offers a fast way to retrieve the annotation objects in a particular portion of the map. It’s much faster than doing a linear search of the objects in the annotations property yourself.

## See Also

### Annotating the map

- [annotations](mapkit/mkmapview/annotations.md)
- [addAnnotation(_:)](mapkit/mkmapview/addannotation(_:).md)
- [addAnnotations(_:)](mapkit/mkmapview/addannotations(_:).md)
- [removeAnnotation(_:)](mapkit/mkmapview/removeannotation(_:).md)
- [removeAnnotations(_:)](mapkit/mkmapview/removeannotations(_:).md)
