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

Expose offline routing functionality to Obj-C #1891

Merged
merged 3 commits into from Dec 17, 2018

Conversation

frederoni
Copy link
Contributor

Tail work from #1808 , offline routing now bridges to Obj-C.

cc @1ec5 @JThramer

coordinates = @[[NSValue valueWithMKCoordinate:CLLocationCoordinate2DMake(0, 0)],
[NSValue valueWithMKCoordinate:CLLocationCoordinate2DMake(1, 1)]];

MBCoordinateBounds *bounds = [[MBCoordinateBounds alloc] init:coordinates];
Copy link
Contributor Author

@frederoni frederoni Dec 6, 2018

Choose a reason for hiding this comment

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

init should be refined for Obj-C

PR in mapbox/mapbox-directions-swift#325

@@ -89,7 +89,7 @@ public class NavigationDirections: Directions {
- parameter progressHandler: Unpacking reports progress every 500ms.
- parameter completionHandler: Called when unpacking completed.
*/
public class func unpackTilePack(at filePathURL: URL, outputDirectoryURL: URL, progressHandler: UnpackProgressHandler?, completionHandler: UnpackCompletionHandler?) {
@objc public class func unpackTilePack(at filePathURL: URL, outputDirectoryURL: URL, progressHandler: UnpackProgressHandler?, completionHandler: UnpackCompletionHandler?) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
@objc public class func unpackTilePack(at filePathURL: URL, outputDirectoryURL: URL, progressHandler: UnpackProgressHandler?, completionHandler: UnpackCompletionHandler?) {
@objc(unpackTilePackAtURL:outputDirectoryURL:progressHandler:completionHandler:)
public class func unpackTilePack(at filePathURL: URL, outputDirectoryURL: URL, progressHandler: UnpackProgressHandler?, completionHandler: UnpackCompletionHandler?) {

@1ec5 1ec5 added this to the v0.27.0 milestone Dec 8, 2018
Copy link
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

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

Suggestion for the changelog:

  • The NavigationDirections.unpackTilePack(at:outputDirectoryURL:progressHandler:completionHandler:) method is now available to Objective-C code as -[MBNavigationDirections unpackTilePackAtURL:outputDirectoryURL:progressHandler:completionHandler:]. (#1891)

@@ -41,6 +42,43 @@ - (void)testUpdateRoute {
_routeController.routeProgress = [[MBRouteProgress alloc] initWithRoute:route legIndex:0 spokenInstructionIndex:0];
[self waitForExpectations:@[expectation] timeout:5];
}

// This test is excluded from the test suite. We are just verifying that offline routing bridges to Obj-C at compile time.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we excluding it because the networking is currently unstubbed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, kind of. These tests are just to make sure we don't regress Obj-C bridging.
We have offline tests for fetching available versions, downloading tiles, and unpacking tiles written in Swift with stubbed network.

@frederoni frederoni merged commit 62edeff into master Dec 17, 2018
@frederoni frederoni deleted the fred/offline-routing-objc branch December 17, 2018 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants