---
title: "geocodePostalAddress(_:preferredLocale:completionHandler:)"
framework: corelocation
role: symbol
role_heading: Instance Method
path: "corelocation/clgeocoder/geocodepostaladdress(_:preferredlocale:completionhandler:)"
---

# geocodePostalAddress(_:preferredLocale:completionHandler:)

Submits a forward-geocoding requesting using the specified locale and Contacts framework information.

## Declaration

```swift
func geocodePostalAddress(_ postalAddress: CNPostalAddress, preferredLocale locale: Locale?, completionHandler: @escaping @Sendable ([CLPlacemark]?, (any Error)?) -> Void)
```

```swift
func geocodePostalAddress(_ postalAddress: CNPostalAddress, preferredLocale locale: Locale?) async throws -> [CLPlacemark]
```

## Parameters

- `postalAddress`: A postal address from the Contacts framework.
- `locale`: The locale of the postal address. Specify nil to use the current locale of the user.
- `completionHandler`: The handler block to execute with the results. The geocoder executes this handler regardless of whether the request was successful or unsuccessful. For more information on the format of this block, see doc://com.apple.corelocation/documentation/CoreLocation/CLGeocodeCompletionHandler.

## Discussion

Discussion important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration: func geocodePostalAddress(_ postalAddress: CNPostalAddress, preferredLocale locale: Locale?) async throws -> [CLPlacemark] For information about concurrency and asynchronous code in Swift, see Calling Objective-C APIs Asynchronously. This method submits the specified location data to the geocoding server asynchronously and returns. When the request completes, the geocoder executes the provided completion handler on the main thread. After initiating a forward-geocoding request, do not attempt to initiate another reverse- or forward-geocoding request. Geocoding requests are rate-limited for each app, so making too many requests in a short period of time may cause some of the requests to fail. When the maximum rate is exceeded, the geocoder passes an error object with the value network to your completion handler.

## See Also

### Geocoding an address

- [geocodeAddressString(_:in:preferredLocale:completionHandler:)](corelocation/clgeocoder/geocodeaddressstring(_:in:preferredlocale:completionhandler:).md)
- [geocodeAddressString(_:completionHandler:)](corelocation/clgeocoder/geocodeaddressstring(_:completionhandler:).md)
- [geocodeAddressString(_:in:completionHandler:)](corelocation/clgeocoder/geocodeaddressstring(_:in:completionhandler:).md)
- [geocodePostalAddress(_:completionHandler:)](corelocation/clgeocoder/geocodepostaladdress(_:completionhandler:).md)
- [geocodeAddressDictionary(_:completionHandler:)](corelocation/clgeocoder/geocodeaddressdictionary(_:completionhandler:).md)
