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

# init(mapView:)

Initializes the button with the map view that it should control.

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

## Parameters

`mapView`

The mapView to associate with the button. Taps on the button change the appearance of this map view.

## Return Value

An initialized [`MKUserTrackingButton`](/documentation/MapKit/MKUserTrackingButton) object.

---

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)