Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting the User’s Location from '08 to '26

Getting the User’s Location from '08 to '26

You wouldn't believe how far we've come since when the iPhone was announced in 2007, the first iPhone SDK in 2008, and luckily iOS 4.2 and further. It's unbelievable to me all we could (badly so) do with the original APIs, and how easy and cool it is nowadays with a few SwiftUl and SwiftUl lines to get the user location, while being super sharp on Privacy (which it wasn't in 2007!).
Let me dig into all the details: We'll talk about Precisions, Beacons, Regions, Delegates, Battery, and so on. There will be lots of simple samples which hopefully helps you build with this wonderful technology!

Avatar for Manu Carrasco Molina

Manu Carrasco Molina

September 08, 2026

More Decks by Manu Carrasco Molina

Other Decks in Technology

Transcript

  1. Getting The User’s Location from 2008 to 2026 State of

    the Union Manu @StuFFmc Carrasco Molina
  2. > who/whyami? speaks 1 !2 *" + guy born in

    living in XX years as a dev, XX with / 3 # ,4 #techs Since Day 1 with iPhoneOS, Swift, SwiftUI (gave up visionOS) XX years of political involvement with the #party XX years of climate & human rights #activism #palestine 13+ meat, 10+ it y without Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 of #vegan 2
  3. Core Location was the first Privacy thing made • •

    This talk, like my book addresses: • Developers • Users But this talk is not about Privacy... • Check my previous talks 3
  4. We’ve come a loooooong way iPhoneOS wasn’t so much about

    Privacy This is my iPhone running iPhoneOS 3.1.3 Global switch appeared in iPhoneOS 2 1 "Allow your iPhone to use the Google cell, Skyhook WiFi, and for iPhone 3G, aGPS technologies" 1 https://www.imore.com/iphone-os-2-review Getting the User’s Location from 2008 to 2026, iOSDevUK ‘26 4
  5. iPhoneOS 1 2007 (Preview Jan, June, 2008) ! The first

    years, iPhones arrived in June as well … and iPod touch arrived in September Remember the original iPhone had no GPS. … and we didn’t have an official SDK yet, nor screenshots! Pictures: Peter Kurzok 5
  6. iPhoneOS 2 2008 • [iPhone 3G, Touch 2] Manu @StuFFmc

    Carrasco Molina • Getting the User’s Location from '08 to '26 7
  7. The Manager ⚠ Let me introduce… Clapp! The CoreLocation Apps

    github.com/stuffmc Syntax is iOS 17+/SwiftUI throughout this talk — the CoreLocation APIs themselves are shown as they were at each point in time. Everything this talk covers is built on exactly this shape, but my Demo Projects are using old Syntax. Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 8
  8. The Manager @Observable class LocationManager { var authorizationStatus: CLAuthorizationStatus? }

    struct LocationView: View { @State private var manager = LocationManager() var body: some View { if let status = manager.authorizationStatus { Text("\(status.rawValue)") } // nil, nothing to see here... } } Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 11
  9. Statuses enum CLAuthorizationStatus { case notDetermined = 0 case restricted

    = 1 case denied = 2 // Off case authorized = 3 // On } Like most properties and methods, this is in CLLocationManager. Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 12
  10. @Observable class LocationManager: NSObject, CLLocationManagerDelegate { private var manager =

    CLLocationManager() override init() { super.init() manager.delegate = self } func locationManagerDidChangeAuthorization( _ manager: CLLocationManager, authorizationStatus: CLAuthorizationStatus ) { self.authorizationStatus = authorizationStatus } // 0, notDetermined } Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 13
  11. CLLocationManager + delegate — unchanged since iPhoneOS 2 On startUpdatingLocation()

    the system prompts first time only 2 private var locations = [CLLocation]() func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { self.locations = locations } 2 Steve explains exactly this in the D8 clip, coming up next Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 14
  12. !" .desiredAccuracy typealias CLLocationAccuracy = Double Does its best to

    achieve the requested accuracy Apps must be prepared to use less accurate data Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 let CLLocationAccuracyBest = -1 let _NearestTenMeters = 10 let _HundredMeters = 100 let _Kilometer = 1000 let _ThreeKilometers = 3000 Unchanged since iPhoneOS 2 — still your first decision as a developer today 16
  13. Save & ! start? Don’t forget to stopUpdatingLocation! 3 We’ll

    see better ways to do this later 3 ... when you get enough! Find My talk about Energy Optimization @ speakerdeck.com Z. Veselinovic (CC BY-SA 2.0) 17
  14. iPhoneOS 3 2009 • [iPhone 3GS, Touch 3] Manu @StuFFmc

    Carrasco Molina • Getting the User’s Location from '08 to '26 18
  15. CoreLocation in iPhoneOS 3 CLHeading — digital compass heading support

    (3GS magnetometer) startUpdatingHeading / stopUpdatingHeading headingAvailable Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 19
  16. Give Steve 2^6 Seconds June 2010 Before anyone spoke about

    Privacy 6 to 8 years before GDPR, and just before iOS 4 Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 20
  17. iOS 4 2010 • [iPhone 4 Retina, Touch 4, iPad]

    First, Only iPad had iPhoneOS 3.2 First, Only iPhone had iOS 4.0 and 4.1 Finally both had iOS 4.2 Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 22
  18. Per-App Authorization Location Services was not under Privacy but General

    in iOS 4. The next slide compares 2010 to 2026 Only then could we revoke a permission? It also compares the resolution of our Phones :-) Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 23
  19. 24

  20. Your first taste of background execution The ability to run

    multiple apps in the background on iOS was introduced with iOS 4 in June 2010. This version introduced multitasking, allowing apps to perform certain tasks (like playing music, using VoIP, or completing background uploads/downloads) while suspended or in the background. However, full background execution for all apps was still restricted—only specific background modes were supported. Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 25
  21. CoreLocation in iOS 4 let CLLocationAccuracyBestForNavigation = -2 Intended for

    use in navigation apps that require precise position at all times. Because of the extra power, use this level of accuracy only while the device is plugged in. CLRegion — geofencing arrives startMonitoringForRegion: — region monitoring st…SignificantLocationChanges > low-power background updates Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 26
  22. iOS 5 2011 [iPhone 4S, iPad 2] No new iPod

    Touch Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 27
  23. CoreLocation in iOS 5 CLGeocoder — forward & reverse geocoding

    Replaces the old MKReverseGeocoder APIs deprecated as of iOS 7 and earlier are unavailable in Swift If anyone knows about iOS 26, you’ll be amazed at the end of this talk Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 28
  24. iOS 6 2012 Bigger iPhone 5 ⚡ ⚡ iPad 3+4

    , iPad Mini Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 29
  25. CoreLocation in iOS 6 activityType tells what you’re doing (driving,

    fitness) to tune accuracy & power case other = 1 case automotiveNavigation case fitness case otherNavigation pausesLocationUpdatesAutomatically — auto-pauses updates once you stop moving, on by default Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 30
  26. CoreLocation in iOS 6 allowDeferredLocationUpdatesUntilTraveled:timeout: — batch/ defer delivery to

    save power Deprecated in iOS 13 — “You can remove calls to this method”, the OS just does it now NSLocationUsageDescription (Info.plist) replaces the old, runtimeset purpose property Time for a Slido Poll about which iOS Version you support... Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 31
  27. iOS 7 2013 iPhone 5S , 5c ! iPad Air,

    mini 2 Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 32
  28. True background app execution—where apps could run tasks in the

    background without being suspended — was introduced in iOS 7. This version expanded the background capabilities significantly, allowing apps to: • Fetch data in the background (Background App Refresh). • Perform background downloads/uploads (e.g., for files or content updates). • Run background tasks for finite periods (using beginBackgroundTaskWithName:expirationHandler:). Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 33
  29. CoreLocation in iOS 7: Region Monitoring wakes/launches your app in

    the background on enter/exit CLRegion becomes an abstract base class CLCircularRegion — the concrete subclass for classic geofences CLRegionState (.inside / .outside / .unknown) + requestStateForRegion: — ask "where am I right now?" without waiting for a boundary crossing Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 34
  30. CoreLocation in iOS 7: Beacons CLBeaconRegion / CLBeacon, proximity to

    Bluetooth LE beacons startRangingBeaconsInRegion: → didRangeBeacons:inRegion: Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 35
  31. < iOS 8, there was no custom message from the

    Info.plist. Apps could start updates (e.g. startUpdatingLocation) without explicitly requesting user permission. The system would show a generic, non-customizable alert (e.g., [App Name] Would Like to Use Your Current Location) when an app first attempted to access location services. There was no requirement to include a usage description. Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 36
  32. iOS 8 2014 ! iPhone 6, + iPad Air 2

    , mini 3 Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 37
  33. New Statuses enum CLAuthorizationStatus { case notDetermined = 0 case

    restricted = 1 case denied = 2 // "Never" case authorizedAlways = 3 // iOS 8 case authorizedWhenInUse = 4 // iOS 8 // Also "When I Share" static var authorized // authorizedAlways } ⚠ Region Monitoring needs Always < iOS 13! Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 38
  34. Asking For It in/since iOS 8 4 requestWhenInUseAuthorization 4 requestAlwaysAuthorization

    Screenshots: Mattt Thompson, "Core Location in iOS 8", NSHipster, Nov 2014 — nshipster.com/core-location-in-ios-8 Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 39
  35. CLVisit ! open-ended dwell events Settings → Privacy & Security

    → Location Services → System Services 7 → Significant Locations manager.startMonitoringVisits() func locationManager(_ manager: visit didVisit:) { visit.arrivalDate // .distantPast if unknown visit.departureDate // .distantFuture if ongoing visit.coordinate visit.horizontalAccuracy } 7 UI introduced in iOS 7 as "Frequent Locations”. Detail dialed back over subsequent iOS versions. Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 40
  36. One Switch, Every Manager startMonitoringVisits() is a global switch: every

    CLLocationManager your app owns — current and future — starts delivering visits to its delegate Survives app relaunch, like region monitoring Start/stop are async — "may not immediately reflect in delegate callback patterns" Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 41
  37. iOS 9 2015 iPhone 6s, +, Touch 6 iPad Pro

    13”, 9”, mini 4 Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 42
  38. Get only 1 Location requestLocation only gives one Delegate Callback

    allowsBackgroundLocationUpdates — new switch (+ location background mode) needed to keep continuous updates flowing while suspended CLPlacemark.timeZone — geocoding results now carry a time zone Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 43
  39. iOS 10 2016 • [iPhone 7, +] Manu @StuFFmc Carrasco

    Molina • Getting the User’s Location from '08 to '26 44
  40. CoreLocation in iOS 10 Nothing new. Swept up in Swift

    3’s Grand Renaming instead NotDetermined → notDetermined, NSDate → Date, NSUUID → UUID… Same APIs, new spelling Usage descriptions —> see next ↓ Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 45
  41. iOS 11 2017 iPhone 8/+/X iPad, iPad Pro 10" Manu

    @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 46
  42. Always ! Will only happen later — iOS 11+ hides

    Always from the first ask 8 App gets When In Use first; system offers the upgrade later Avoid it if you can — it's draining battery 8 WWDC19, session 705 — “What’s New in Core Location” Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 47
  43. Usage Descriptions: iOS 3.2 → iOS 11 iOS 3.2 —

    .purpose: runtime string on the manager • fully optional iOS 6.0 — NSLocationUsageDescription (Info.plist) becomes available, replacing .purpose — still not enforced iOS 8.0 — AlwaysUsageDescription & WhenInUseUsageDescription + App Store starts rejecting missing keys at submission iOS 10 — Missing key = hard crash at runtime (not just location). iOS 11 — New NSLocationAlwaysAndWhenInUseUsageDescription + AlwaysUsageDescription deprecated for apps targeting iOS 11+. Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 48
  44. CL in iOS 11 showsBackgroundLocationIndicator 6 "While Using the App”

    system-level option 6 TechCrunch: Blue bar will shame Apps... Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 49
  45. geocodeAddressDictionary → geocodePostalAddress Previous API used the old AddressBook (in

    C!) framework from iOS 2 CLGeocoder gains a Contacts-based method: geocodePostalAddress let address = CNMutablePostalAddress() address.street = "1 Infinite Loop" address.city = "Cupertino" geocoder.geocodePostalAddress(address) { placemarks, error in // Wait for it in iOS 26 ... } Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 50
  46. iOS 12 2018 [XR/XS, iPad, Pros w/ FaceID] Manu @StuFFmc

    Carrasco Molina • Getting the User’s Location from '08 to '26 51
  47. CoreLocation in iOS 12 New activity type: CLActivityTypeAirborne Tunes location

    filtering for flying, paragliding, drones, skydiving… No dedicated CoreLocation session at WWDC — easy to miss Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 52
  48. iOS 13 2019 iPhone 11/Pro/Max, iPhone SE 2, iPad, mini

    5, Air 3 ! The last iPod Touch 7 (still smaller than iPhone 6) who died in 2022 oh, and now iPadOS 13 … Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 53
  49. Always ! downgrade Holding Always earns a periodic reminder if

    background location used User can downgrade back to When In Use right from the prompt Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 54
  50. Authorization: iOS 13 adds a third way to say yes:

    The Ask Next Time or When I Share option for Core Location / Location Services in iOS was introduced as part of iOS 13. This feature allows apps to request location access with a one-time permission that triggers the next time the app is used or when the user shares content, rather than immediately granting or denying access. This gives users more granular control over their privacy settings. Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 55
  51. Allow once New in the dialog itself, not the API

    It is authorizedWhenInUse but only for one session Shown for both requests from iOS 8 And CLRegion now works with whenInUse Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 56
  52. iOS 14 2020 iPhone 12/Pro/Max/mini New iPads Button order swapped

    in iOS 14 Getting the User’s Location from 2008 to 2026, iOSDevUK ‘26 57
  53. I Made a wish in the book The book has

    “fresh” ! iOS 13 Code, and sooo... Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 58
  54. ↘ Accuracy ↗ @available(iOS 14.0, *) let kCLLocationAccuracyReduced : CLLocationAccuracy

    6 Kilometers in my tests Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 59
  55. Full or reduced @available(iOS 14.0, *) open var accuracyAuthorization: CLAccuracyAuthorization

    { get } public enum CLAccuracyAuthorization : Int { case fullAccuracy = 0 case reducedAccuracy = 1 } @available(iOS 14.0, *) func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) { manager.authorizationStatus manager.accuracyAuthorization } Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 60
  56. The user has chosen to grant this application access to

    location information with reduced accuracy. Region monitoring and beacon ranging are not available to the application. Other CoreLocation APIs are available with reduced accuracy. Location estimates will have a horizontalAccuracy on the order of about 5km. Applications should be prepared to receive locations that are up to 20 minutes old. Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 61
  57. If the user said no or turned this off... You

    can request it once! requestTemporaryFullAccuracyAuthorization( withPurposeKey: "FULL_ACCURACY" ) Full accuracy, but timely limited Useful also for CLRegion The key is from your Plist, see Clapp Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 62
  58. The iOS 18 way session = CLServiceSession( authorization: .whenInUse, fullAccuracyPurposeKey:

    "FULL_ACCURACY" ) Same prompt, same purpose key No manual call — the session asks for you, and holds it We’ll meet CLServiceSession properly later Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 63
  59. Remember this from iOS 4? let CLLocationAccuracyBestForNavigation This level of

    accurate is available only if isAuthorizedForPreciseLocation is true. This property was only during 14.0 Beta. The documentation should say only if AccuracyAuthorization is fullAccuracy Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 64
  60. iOS 15 2021 13 Pro/Max/Mini iPad, mini 6 with FaceID!

    … and new Pros Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 65
  61. sourceInformation Shipped quietly, no session, no docs let source =

    manager.location?.sourceInformation source?.isSimulatedBySoftware source?.isProducedByAccessory Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 // // true in the Simulator true from CarPlay / MFi 66
  62. LocationButton import CoreLocationUI var body: some View { if let

    status = manager.authorizationStatus { Text("\(status.rawValue)") } LocationButton { manager.startUpdatingLocation() } } Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 67
  63. 69

  64. .formatted is also iOS 15 List(manager.locations, id: \.timestamp) { Text($0.timestamp

    .formatted(date: .omitted, time: .shortened) ) Text($0.coordinate.latitude.description) Text($0.coordinate.longitude.description) } Convenient Date().formatted Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 71
  65. iOS 16 2022 14,+, Pro, Max, SE 3 iPad 10,

    Air M1, New iPad Pro (All with FaceID) Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 72
  66. CoreLocation in iOS 16 Nothing found for CoreLocation this year

    Next stop: iOS 17 — CLMonitor & liveUpdates Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 73
  67. iOS 17 2023 [15,+, Pro, Max] Manu @StuFFmc Carrasco Molina

    • Getting the User’s Location from '08 to '26 74
  68. The Modern Manager LocationButton(.shareMyCurrentLocation) { Task { for try await

    update in CLLocationUpdate.liveUpdates() { if let coordinate = update.location?.coordinate { latitude = coordinate.latitude longitude = coordinate.longitude } } } } // No Delegate, No Request! Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 75
  69. Save & ! " , Region Monitoring let monitor =

    await CLMonitor("Greeter") let center = CLLocationCoordinate2D( latitude: 37.33233141, longitude: -122.0312186) let condition = CLMonitor.CircularGeographicCondition( center: center, radius: 100) await monitor.add(condition, identifier: "atApple") Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 77
  70. Listening for Events for try await event in await monitor.events

    { switch event.state { case .satisfied: print("Entered") case .unsatisfied: print("Left") default: break } } One AsyncSequence. No delegate, no polling loop Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 78
  71. CL for visionOS Native Apps No real foreground/background on AVP

    — “while using” means being looked at or few seconds after you look away authorizedAlways, region monitoring, beacon ranging, and deferred updates are all still marked API_UNAVAILABLE in visionOS 27. Accuracy: ~100m standalone, like a Mac (no GPS chip) → iPhonelevel the moment one’s nearby “Meet Core Location for spatial computing”, WWDC23, session 10146 80
  72. Compatibility Mode Unmodified iOS/iPadOS binary, built against the iOS SDK

    — old symbols compile just fine, the API_UNAVAILABLE(visionos) tags never applied to you requestAlwaysAuthorization() gets silently redirected to a While5 Using request instead 5 “Apps which prompt for Always will have their request redirected to request authorization while in use.” — WWDC23, session 10146 “Meet Core Location for spatial computing”, WWDC23, session 10146 81
  73. Silent Failures startMonitoringForRegion: / CLMonitor? The call succeeds — the

    events just never arrive No crash, no exception, no console warning Apple’s own warning: “consider if your app assumes a particular API is always supported” “Meet Core Location for spatial computing”, WWDC23, session 10146 82
  74. iOS 18 2024 16, +, Pro, Max, e iPad mini

    A17, Air M2, new Pros Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 83
  75. CLServiceSession session = CLServiceSession( authorization: .always, fullAccuracyPurposeKey: "FULL_ACCURACY" ) Keeps

    your Always authorization “alive” while it exists Hold it in @State or a property — deallocate it, it ends Pairs naturally with CLMonitor for background conditions Also replaces requestTemporaryFullAccuracyAuthorization Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 84
  76. iOS 26 2025 17, Air, Pro, Max, e iPad A17,

    Air M3, new Pros Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 85
  77. CLGeocoder — The Full Story iOS 5 ('11): CLGeocoder arrives,

    replacing MKReverseGeocoder — ships with geocodeAddressDictionary, a raw AddressBook dict iOS 9 ('15): Contacts replaces AddressBook (geocoder untouched) iOS 11 ('17): Dict method dies — geocodePostalAddress arrives iOS 26 ('25): Whole class deprecated — CLGeocoder (and geocodePostalAddress with it) → MKReverseGeocodingRequest Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 86
  78. CLGeocoder Full Circle ! // iOS 5 → iOS 18

    let geocoder = CLGeocoder() // iOS 26+: MapKit takes over — same job, new home if let request = MKReverseGeocodingRequest(location: location) { let mapItem = try await request.mapItems.first } Replaced MKReverseGeocoder in iOS 5, replaced by MapKit in iOS 26 Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 87
  79. Deprecated ≠ Worse (Yet) "I then enumerate its attributes to

    pull out specific elements like just the street or state or zip. Am I missing some way to get the postal address?" — a developer, on Apple’s own Developer Forums Apple DTS’ answer: "I realize the options are not as granular as you would like…” but also "hand-rolling something like [street, city, state].joined(separator: ", ") looks fine for US addresses but silently produces wrong-looking output in places with different addressing conventions" Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 88
  80. Not as granular — No shit CLGeocoder → CNPostalAddress: street,

    city, state, zip, ISO country — separate fields MKReverseGeocodingRequest → MKAddress / MKAddressRepresentations: formatted strings only So it’s only for Display Purposes, sure, it might be better (if you can afford to support iOS 26+) Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 89
  81. Probably don’t update just yet No head start: MKGeocodingRequest /

    MKReverseGeocodingRequest also ship in iOS 26 — nothing to adopt before raising your deployment target As we just saw: no structured address data yet either Deprecated isn't the same as broken — CLGeocoder might be the better tool for you for now Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 90
  82. iOS 27 2026 [17e, iPad Air M4] Manu @StuFFmc Carrasco

    Molina • Getting the User’s Location from '08 to '26 91
  83. CoreLocation in iOS 27 headingOrientation deprecated → headingBody (CLBodyIdentifiable) Enum

    → protocol: heading may now come from more than just "phone held a certain way" New activity type: CLActivityTypeMaritime (Straight from the headers — no WWDC26 session, no docs yet) Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 92
  84. If you take one thing Manu @StuFFmc Carrasco Molina •

    Getting the User’s Location from '08 to '26 93
  85. Upgrade your code and users! Try to move to current

    (not Beta!) every year after WWDC e.g. by now your App should ideally only support iOS 26+ It's your chance to clean your code, and use the new features! Exceptions If you start building a new app, build for iOS 27! For Core Location, iOS 18 is probably enough though... Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 94
  86. Farewell, Tim! Tim Cook, MSNBC, 2018 Manu @StuFFmc Carrasco Molina

    • Getting the User’s Location from '08 to '26 95
  87. 96

  88. Sorry Tim, but no Privacy ain’t no Murica thing, buddy

    Manu @StuFFmc Carrasco Molina • Getting the User’s Location from '08 to '26 97