<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MKCompassButton/init(mapView:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MKCompassButton(cm)compassButtonWithMapView:"
  },
  "title" : "init(mapView:)"
}
-->

# init(mapView:)

Creates a compass button and associates it with the specified map view.

```
convenience init(mapView: MKMapView?)
```

## Parameters

`mapView`

The map to associate with the compass button. The compass button reflects the orientation of this map, and tapping the button reorients the map appropriately.

## Return Value

An initialized compass button.

## Discussion

---

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)