0

I am currently using CLGeocoder in weather app on iOS to handle user's location queries. I then use the region property of the resulting CLPlacemark objects to obtain the region corresponding to the query and cast to CLCircularRegion as I am using both the center coordinate and the radius. I make use of the radius to ensure that (for example) I return more general results for a city-sized region and more specific results for a block-sized region. I also use this to display the region on a map with a MKCircle annotation to help users see if their query resulted in the intended granularity.

I understand that as of iOS 26.0 and macOS 26.0 CLGeocoder has been deprecated in favor of MKGeocodingRequest, and I would like to adopt the new API as soon as possible (while supporting fallback to CLGeocoder on older platforms as needed). While I have implemented this successfully, the results of MKGeocodingRequest are MKMapItems. Since I am trying to avoid deprecated APIs, I am unable to use the .placemark property of MKMapItem to obtain the radius information as that is also deprecated as of iOS 26.0/macOS 26.0.

I am therefore inquiring as to whether anyone has an alternative method of obtaining the circular region, bounding box, or radius corresponding to a MKMapItem that does not rely on a deprecated API.

I realize this may be more on-topic for Apple Developer forums than Stack Overflow; however, as another user (not me) has posted an identical question about the results of the deprecation of CLGeocoder on Apple Developer without response, I am hoping that perhaps another developer on Stack Overflow has already encountered this problem and found a resolution.

2
  • Looking at the documentation, you can see that it is said to use the location property of a MKMapItem to get information about the location associated with the item. This property is of type CLLocation and you can read more about it here. Commented 1 hour ago
  • @tomerpacific - CLLocation provides the latitude and longitude corresponding to the queried location, but the radius property which is required for my application is only available from CLCircularRegion, which (to my knowledge at least) can only be obtained by casting from the region property of a CLPlacemark. Commented 1 hour ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.