Fix iOS deprecation warnings
This commit is contained in:
@@ -73,7 +73,9 @@ enum LiveActivityManager {
|
||||
currentStartDate = nil
|
||||
start(attributes: attributes, state: state)
|
||||
} else {
|
||||
Task { await current.update(using: state) }
|
||||
Task {
|
||||
await current.update(.init(state: state, staleDate: nil))
|
||||
}
|
||||
}
|
||||
} else {
|
||||
start(attributes: attributes, state: state)
|
||||
|
||||
@@ -73,8 +73,12 @@ 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