From 446aecc009c2ccf13cbc7be33781c08475df906d Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Wed, 14 Aug 2024 02:06:01 -0700 Subject: [PATCH] unused Polyline module and Event code (#90) --- MapboxCoreNavigation/CoreFeedbackEvent.swift | 42 -------------------- MapboxCoreNavigation/MMEEventsManager.swift | 1 - MapboxCoreNavigation/RouteController.swift | 1 - 3 files changed, 44 deletions(-) delete mode 100644 MapboxCoreNavigation/CoreFeedbackEvent.swift diff --git a/MapboxCoreNavigation/CoreFeedbackEvent.swift b/MapboxCoreNavigation/CoreFeedbackEvent.swift deleted file mode 100644 index 5935b87c..00000000 --- a/MapboxCoreNavigation/CoreFeedbackEvent.swift +++ /dev/null @@ -1,42 +0,0 @@ -import Foundation -import MapboxDirections -import Polyline - -class CoreFeedbackEvent: Hashable { - var id = UUID() - - var timestamp: Date - - var eventDictionary: [String: Any] - - init(timestamp: Date, eventDictionary: [String: Any]) { - self.timestamp = timestamp - self.eventDictionary = eventDictionary - } - - func hash(into hasher: inout Hasher) { - hasher.combine(self.id) - } - - static func == (lhs: CoreFeedbackEvent, rhs: CoreFeedbackEvent) -> Bool { - lhs.id == rhs.id - } -} - -class FeedbackEvent: CoreFeedbackEvent { - func update(type: FeedbackType, source: FeedbackSource, description: String?) { - eventDictionary["feedbackType"] = type.description - eventDictionary["source"] = source.description - eventDictionary["description"] = description - } -} - -class RerouteEvent: CoreFeedbackEvent { - func update(newRoute: Route) { - if let geometry = newRoute.coordinates { - eventDictionary["newGeometry"] = Polyline(coordinates: geometry).encodedPolyline - eventDictionary["newDistanceRemaining"] = round(newRoute.distance) - eventDictionary["newDurationRemaining"] = round(newRoute.expectedTravelTime) - } - } -} diff --git a/MapboxCoreNavigation/MMEEventsManager.swift b/MapboxCoreNavigation/MMEEventsManager.swift index f86018d1..a4784cb9 100644 --- a/MapboxCoreNavigation/MMEEventsManager.swift +++ b/MapboxCoreNavigation/MMEEventsManager.swift @@ -1,6 +1,5 @@ import AVFoundation import MapboxDirections -import Polyline import UIKit let SecondsBeforeCollectionAfterFeedbackEvent: TimeInterval = 20 diff --git a/MapboxCoreNavigation/RouteController.swift b/MapboxCoreNavigation/RouteController.swift index b41ab25b..cd85d545 100644 --- a/MapboxCoreNavigation/RouteController.swift +++ b/MapboxCoreNavigation/RouteController.swift @@ -1,7 +1,6 @@ import CoreLocation import Foundation import MapboxDirections -import Polyline import Turf import UIKit