Fix iOS deprecation warnings
This commit is contained in:
@@ -73,7 +73,9 @@ enum LiveActivityManager {
|
|||||||
currentStartDate = nil
|
currentStartDate = nil
|
||||||
start(attributes: attributes, state: state)
|
start(attributes: attributes, state: state)
|
||||||
} else {
|
} else {
|
||||||
Task { await current.update(using: state) }
|
Task {
|
||||||
|
await current.update(.init(state: state, staleDate: nil))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
start(attributes: attributes, state: state)
|
start(attributes: attributes, state: state)
|
||||||
|
|||||||
@@ -73,8 +73,12 @@ enum RoadDistanceService {
|
|||||||
/// Driving distance (metres) between two coordinates via Apple Maps routing.
|
/// Driving distance (metres) between two coordinates via Apple Maps routing.
|
||||||
private static func roadMeters(from: CLLocationCoordinate2D, to: CLLocationCoordinate2D) async -> Double? {
|
private static func roadMeters(from: CLLocationCoordinate2D, to: CLLocationCoordinate2D) async -> Double? {
|
||||||
let request = MKDirections.Request()
|
let request = MKDirections.Request()
|
||||||
request.source = MKMapItem(placemark: MKPlacemark(coordinate: from))
|
request.source = MKMapItem(location: CLLocation(latitude: from.latitude,
|
||||||
request.destination = MKMapItem(placemark: MKPlacemark(coordinate: to))
|
longitude: from.longitude),
|
||||||
|
address: nil)
|
||||||
|
request.destination = MKMapItem(location: CLLocation(latitude: to.latitude,
|
||||||
|
longitude: to.longitude),
|
||||||
|
address: nil)
|
||||||
request.transportType = .automobile
|
request.transportType = .automobile
|
||||||
request.requestsAlternateRoutes = false
|
request.requestsAlternateRoutes = false
|
||||||
do {
|
do {
|
||||||
|
|||||||
Reference in New Issue
Block a user