Conversation
|
|
||
| if route != routeController.routeProgress.route { | ||
| routeController.routeProgress = RouteProgress(route: route) | ||
| routeController.routeProgress.currentLegProgress.stepIndex = 0 |
There was a problem hiding this comment.
This is set to 0 when reseting the route progress.
| } | ||
| } | ||
|
|
||
| if route != routeController.routeProgress.route { |
There was a problem hiding this comment.
Is this check safe when we don't implement -hash, -isEqual: or an overloaded operator?
There was a problem hiding this comment.
Do we actually even need to check if theyre different? Couldn't we just always blow it away
There was a problem hiding this comment.
We can, but it should then be moved to the route’s didSet to avoid initializing an excessive RouteProgress.
There was a problem hiding this comment.
If we don't override isEqual, it ends up doing a pointer equality check. That won't be as thorough.
| } | ||
| } | ||
|
|
||
| class func downloadRouteFixture(coordinates: [CLLocationCoordinate2D], fileName: String, completion: @escaping () -> Void) { |
There was a problem hiding this comment.
We could put this behind an #if to prevent ourselves from checking in tests that call this function.
This PR makes it a bit more convenient to change the route on the fly by notifying the
RouteMapViewControllerand theRouteTableViewControllerabout the update along with initializing aRouteProgressfor the new route.@bsudekum @ericrwolfe 👀