<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MKGeocodingRequest",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MKGeocodingRequest"
  },
  "title" : "MKGeocodingRequest"
}
-->

# MKGeocodingRequest

A class that looks up a geographic coordinate using the provided string.

```
class MKGeocodingRequest
```

## Discussion

Use this class to look up the coordinate for an address string you provide, for example if you want to display the location in a map. This example shows how to use a <doc://com.apple.documentation/documentation/Swift/Task> modifier on a SwiftUI view to geocode an array of street addresses to the corresponding coordinates that MapKit returns in an array of [`MKMapItem`](/documentation/MapKit/MKMapItem) objects.

```swift
struct MyGeocoderView: View {

    let addressVisits = [
        "Bethesda Terrace, Central Park \n New York, NY 10023 \n United States",
        "Mill Creek Park Fountain, \n Kansas City, Missouri, \n United States",
        "Archibald Fountain, 110 Elizabeth St \n Sydney NSW 2000 \n Australia"
    ]
    @State var addressVisitMapItems: [MKMapItem] = []
    var body: some View {
    // SwiftUI body views
    }
    .onAppear {
        Task {
            var addressMapItems = [MKMapItem]()
            for address in addressVisits {
                if let request = MKGeocodingRequest(addressString: address) {
                    do {
                        let mapitems = try await request.mapItems
                        if let mapitem = mapitems.first {
                            addressMppItems.append(mapitem)
                        }
                    } catch let error {
                        print("error: \(error)")
                    }
                }
            }
            addressVisitMapItems = addressMapItems

            // The `addressVisitMapItems` array contains `MKMapItem` items that provide information that describe
            // the geographic coordinates, the specific address, and other rich data about the provided locations:
            //
            // "New York, NY 10023 United States" at (40.76821482, -73.98669500)
            // "West 43rd St, Kansas City, MO 64111 United States" at (39.04979190, -94.59874170)
            // "110 Elizabeth St Sydney NSW 2000 Australia" at (33.87171620, 151.21150870)
        }
    }
```

## Topics

### Creating a geocoding request object

[`init(addressString:)`](/documentation/MapKit/MKGeocodingRequest/init(addressString:))

Initializes a new geocoder request object with the provided address string.

### Getting the geocoder’s state

[`isLoading`](/documentation/MapKit/MKGeocodingRequest/isLoading)

A Boolean value that indicates whether the current geocoding request is in a loading state.

[`isCancelled`](/documentation/MapKit/MKGeocodingRequest/isCancelled)

A Boolean value that indicates whether the current geocoding request is in a cancelled state.

### Controlling the geocoder’s operation

[`cancel()`](/documentation/MapKit/MKGeocodingRequest/cancel())

A function you call to cancel a geocoding request that’s in progress.

### Getting information about the geocoder

[`addressString`](/documentation/MapKit/MKGeocodingRequest/addressString)

The string used to initialize the geocoder.

[`getMapItems(completionHandler:)`](/documentation/MapKit/MKGeocodingRequest/getMapItems(completionHandler:))

Returns the map items relevant to the geocoded location.

[`preferredLocale`](/documentation/MapKit/MKGeocodingRequest/preferredLocale)

A value that indicates the default locale the geocoder should use when processing requests.

[`region`](/documentation/MapKit/MKGeocodingRequest/region)

The geographic region for the framework to use as the bounds for the request; defaults to a region that covers the whole world.



---

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)