HomeiOS Developmentios - CLGeocoder deprecation: How can I receive geocoding bounds in MapKit?

ios – CLGeocoder deprecation: How can I receive geocoding bounds in MapKit?


I’m at present utilizing CLGeocoder in climate app on iOS to deal with consumer’s location queries. I then use the area property of the ensuing CLPlacemark objects to acquire the area equivalent to the question and forged to CLCircularRegion as I’m utilizing each the middle coordinate and the radius. I make use of the radius to make sure that (for instance) I return extra common outcomes for a city-sized area and extra particular outcomes for a block-sized area. I additionally use this to show the area on a map with a MKCircle annotation to assist customers see if their question resulted within the meant granularity.

I perceive that as of iOS 26.0 and macOS 26.0 CLGeocoder has been deprecated in favor of MKGeocodingRequest, and I wish to undertake the brand new API as quickly as attainable (whereas supporting fallback to CLGeocoder on older platforms as wanted). Whereas I’ve applied this efficiently, the outcomes of MKGeocodingRequest are MKMapItems. Since I’m attempting to keep away from deprecated APIs, I’m unable to make use of the .placemark property of MKMapItem to acquire the radius data as that can be deprecated as of iOS 26.0/macOS 26.0.

I’m subsequently inquiring as as to whether anybody has another technique of acquiring the round area, bounding field, or radius equivalent to a MKMapItem that doesn’t depend on a deprecated API.

I understand this can be extra on-topic for Apple Developer boards than Stack Overflow; nevertheless, as one other consumer (not me) has posted an an identical query in regards to the outcomes of the deprecation of CLGeocoder on Apple Developer with out response, I hope that maybe one other developer on Stack Overflow has already encountered this downside and located a decision.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments