<!--
{
  "availability" : [
    "iOS: 4.2.0 -",
    "iPadOS: 4.2.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/annotations(in:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MKMapView(im)annotationsInMapRect:"
  },
  "title" : "annotations(in:)"
}
-->

# annotations(in:)

Returns the annotation objects within the specified map rectangle.

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

## Parameters

`mapRect`

The portion of the map that you want to search for annotations.

## Return Value

The set of annotation objects within `mapRect`.

## 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`](/documentation/MapKit/MKMapView/annotations) property yourself.

---

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)