Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up NavigationMapViewDelegate method names #1378

Merged
merged 1 commit into from
May 9, 2018

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented May 3, 2018

Reverted some NavigationMapViewDelegate method names to conform to Objective-C naming conventions and be more consistent.

Relative to master:

Old (Swift) New (Swift) Old (Objective-C) New (Objective-C)
navigationMapView(_:shapeDescribing:) navigationMapView(_:shapeFor:) -navigationMapView:shapeDescribing: -navigationMapView:shapeForRoute:
navigationMapView(_:simplifiedShapeDescribing:) navigationMapView(_:simplifiedShapeFor:) -navigationMapView:simplifiedShapeDescribing: -navigationMapView:simplifiedShapeForRoute:
navigationMapView(_:shapeFor:legIndex:) navigationMapView(_:shapeFor:legIndex:) -navigationMapView:shapeFor:legIndex: -navigationMapView:shapeForWaypoints:legIndex:
navigationMapView(_:imageFor:) navigationMapView(_:imageFor:) -navigationMapView:imageFor: -navigationMapView:imageForAnnotation:
navigationMapView(_:viewFor:) navigationMapView(_:viewFor:) -navigationMapView:viewFor: -navigationMapView:viewForAnnotation:

Relative to v0.17.0-beta.1, the only changes are:

Old (Swift) New (Swift) Old (Objective-C) New (Objective-C)
navigationMapView(_:shapeDescribing:) navigationMapView(_:shapeFor:) -navigationMapView:shapeDescribingRoute: -navigationMapView:shapeForRoute:
navigationMapView(_:simplifiedShapeDescribing:) navigationMapView(_:simplifiedShapeFor:) -navigationMapView:simplifiedShapeDescribingRoute: -navigationMapView:simplifiedShapeForRoute:
navigationMapView(_:shapeFor:legIndex:) navigationMapView(_:shapeFor:legIndex:) -navigationMapView:shapeDescribingWaypoints:legIndex: -navigationMapView:shapeForWaypoints:legIndex:

Fixes #1375.

/cc @vincethecoder @bsudekum

@1ec5 1ec5 added op-ex Refactoring, Tech Debt or any other operational excellence work. Objective-C labels May 3, 2018
@1ec5 1ec5 added this to the v0.17.0 milestone May 3, 2018
@1ec5 1ec5 self-assigned this May 3, 2018
@1ec5 1ec5 force-pushed the 1ec5-delegate-objc-1375 branch 2 times, most recently from fc9da6c to 7285f03 Compare May 8, 2018 23:55
@bsudekum
Copy link
Contributor

bsudekum commented May 9, 2018

Addressed #1376 in 9375fed.

@@ -78,58 +78,58 @@ public protocol NavigationViewControllerDelegate {

If this method is unimplemented, the navigation map view draws the route line using an `MGLLineStyleLayer`.
*/
@objc optional func navigationMapView(_ mapView: NavigationMapView, routeStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?
@objc optional func navigationViewController(_ navigationViewController: NavigationViewController, routeStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer?

/**
Returns an `MGLStyleLayer` that determines the appearance of the route line’s casing.

If this method is unimplemented, the navigation map view draws the route line’s casing using an `MGLLineStyleLayer` whose width is greater than that of the style layer returned by `navigationMapView(_:routeStyleLayerWithIdentifier:source:)`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is outdated.

@@ -468,36 +468,36 @@ open class NavigationViewController: UIViewController {

//MARK: - RouteMapViewControllerDelegate
extension NavigationViewController: RouteMapViewControllerDelegate {
public func navigationMapView(_ mapView: NavigationMapView, routeCasingStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer? {
return delegate?.navigationMapView?(mapView, routeCasingStyleLayerWithIdentifier: identifier, source: source)
public func navigationViewController(_ navigationViewController: NavigationViewController, routeCasingStyleLayerWithIdentifier identifier: String, source: MGLSource) -> MGLStyleLayer? {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are implementations of RouteMapViewControllerDelegate methods, which haven’t been renamed.

- `NavigationMapViewDelegate.navigationMapView(_:viewForAnnotation:)` renamed to `NavigationMapViewDelegate.navigationMapView(_:viewFor:)`.
- `NavigationViewControllerDelegate.navigationViewControllerDidCancelNavigation(_:)` to `NavigationViewControllerDelegate.navigationViewControllerDidDismiss(_:byCanceling:)`
* Renamed several `NavigationMapViewDelegate` methods ([#1364](https://github.com/mapbox/mapbox-navigation-ios/pull/1364), [#1338](https://github.com/mapbox/mapbox-navigation-ios/pull/1338), [#1318](https://github.com/mapbox/mapbox-navigation-ios/pull/1318), [#1378](https://github.com/mapbox/mapbox-navigation-ios/pull/1378)):
* `NavigationViewControllerDelegate.navigationViewControllerDidCancelNavigation(_:)` to `NavigationViewControllerDelegate.navigationViewControllerDidDismiss(_:byCanceling:)`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changelog should list more renamed methods of NavigationViewControllerDelegate.

Reverted some NavigationMapViewDelegate method names to conform to Objective-C naming conventions and be more consistent.
@bsudekum bsudekum merged commit 554c402 into master May 9, 2018
@bsudekum bsudekum deleted the 1ec5-delegate-objc-1375 branch May 9, 2018 20:07
@1ec5 1ec5 added the backwards incompatible changes that break backwards compatibility of public API label Dec 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards incompatible changes that break backwards compatibility of public API op-ex Refactoring, Tech Debt or any other operational excellence work.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants