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

Refine Obj-C bridging for CoordinateBounds #325

Merged
merged 1 commit into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MapboxDirections/MBCoordinateBounds.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CoordinateBounds: NSObject, Codable {
Initializes a `BoundingBox` from an array of `CLLocationCoordinate2D`’s.
*/
@objc
convenience public init(_ coordinates: [CLLocationCoordinate2D]) {
convenience public init(coordinates: [CLLocationCoordinate2D]) {
assert(coordinates.count >= 2, "coordinates must consist of at least two coordinates")

var maximumLatitude: CLLocationDegrees = -90
Expand Down
8 changes: 4 additions & 4 deletions OfflineDirectionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class OfflineDirectionsTests: XCTestCase {
func testDownloadTiles() {

let directions = Directions(accessToken: token, host: host)
let coordinateBounds = CoordinateBounds([CLLocationCoordinate2D(latitude: 37.7890, longitude: -122.4337),
CLLocationCoordinate2D(latitude: 37.7881, longitude: -122.4318)])

let bounds = CoordinateBounds(coordinates: [CLLocationCoordinate2D(latitude: 37.7890, longitude: -122.4337),
CLLocationCoordinate2D(latitude: 37.7881, longitude: -122.4318)])

let version = "2018-10-16"
let downloadExpectation = self.expectation(description: "Download tile expectation")
Expand All @@ -62,7 +62,7 @@ class OfflineDirectionsTests: XCTestCase {
return OHHTTPStubsResponse(fileAtPath: path!, statusCode: 200, headers: headers)
}

_ = directions.downloadTiles(in: coordinateBounds, version: version, completionHandler: { (url, response, error) in
_ = directions.downloadTiles(in: bounds, version: version, completionHandler: { (url, response, error) in
XCTAssertEqual(response!.suggestedFilename, "2018-10-16.tar")
XCTAssertNotNil(url, "url should point to the temporary local file")
XCTAssertNil(error)
Expand Down