Drop deprecated MapKit and ActivityKit calls, and a dead capture
- RoadDistanceService builds route endpoints with MKMapItem(location:address:) instead of the MKPlacemark path deprecated in iOS 26. - LiveActivityManager updates through ActivityContent, replacing the ActivityKit update(using:) call deprecated in iOS 16.2. - The location-update hook no longer captures an unused state object; the closure body already runs on self, so behaviour is unchanged.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
// every row at once; the mode must also be ON for any pass to run at all.
|
||||
|
||||
import Foundation
|
||||
import CoreLocation
|
||||
import MapKit
|
||||
import UIKit
|
||||
import WidgetKit
|
||||
@@ -407,8 +408,14 @@ enum RoadDistanceService {
|
||||
/// Driving distance (metres) between two coordinates via Apple Maps routing.
|
||||
private static func roadMeters(from: CLLocationCoordinate2D, to: CLLocationCoordinate2D) async -> Double? {
|
||||
let request = MKDirections.Request()
|
||||
request.source = MKMapItem(placemark: MKPlacemark(coordinate: from))
|
||||
request.destination = MKMapItem(placemark: MKPlacemark(coordinate: to))
|
||||
request.source = MKMapItem(
|
||||
location: CLLocation(latitude: from.latitude, longitude: from.longitude),
|
||||
address: nil
|
||||
)
|
||||
request.destination = MKMapItem(
|
||||
location: CLLocation(latitude: to.latitude, longitude: to.longitude),
|
||||
address: nil
|
||||
)
|
||||
request.transportType = .automobile
|
||||
request.requestsAlternateRoutes = false
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user