Releases: mapbox/mapbox-directions-swift
Releases · mapbox/mapbox-directions-swift
v0.10.3
v0.10.2
v0.10.1
- While the debugger is paused, you can visually inspect
Route
,RouteLeg
,RouteStep
, andWaypoint
objects using Xcode’s built-in Quick Look feature. (#152) - Fixed an issue causing an exit with multiple exit numbers to correspond to only a single item in the
RouteStep.exitCodes
property. (#149) - Added an
Intersection.outletRoadClasses
property that provides details about the road leading away from the intersection. (#154, #157) - Added properties to
Route
that indicate the access token and API endpoint of theDirections
object that created the route. (#155)
v0.10.0
- Added an
AttributeOptions
option,congestion
, for obtaining the level of traffic congestion along each segment of aRouteLeg
. (#123) - Added a
RouteStep.exitCodes
property that contains the exit number of atakeOffRamp
maneuver. (#147) - Renamed
Directions.urlForCalculating(_:)
tourl(forCalculating:)
to adhere to Swift 3 naming conventions. (#138) - If any of the waypoints of
RouteOptions
is named, those names persist in theRouteLeg
s’ waypoints. - Fixed an issue causing
RouteStep
s to fail to decode if themaneuverDirection
was omitted or unrecognized. (#137) - Changed the raw values of the
AttributeOptions
options. (#123)
Documentation is available online or within Xcode.
v0.9.1
v0.9.0
Changes since v0.8.1:
- Added an option to RouteOptions for obtaining attributes about each node or segment between nodes in the returned route legs. Available attributes include expected speed and travel time. (#118)
- Replaced Route’s
profileIdentifier
property with arouteOptions
property set to the RouteOptions object that was used to obtain the route. (#122)
v0.8.1
v0.8.0
Changes since v0.7.0:
- Migrated to Swift 3.0. If your application is written in Swift 2.3, you should stick to v0.7.x or use the swift2.3 branch. (#57)
- Fixed an issue causing the error “The sandbox is not in sync with the Podfile.lock” when updating a Carthage-based project that requires this framework. (#102)
- Replaced the profile identifier constants with the
MBDirectionsProfileIdentifier
extensible string enumeration, which is available to both Objective-C and Swift. (#106)
v0.7.0
This will be the final Swift 2.x release. Changes since v0.6.0:
- Migrated to Swift 2.3.
- Fixed an error that occurred when archiving an application that links to this library. (#108)
- Added the profile identifier constant
MBDirectionsProfileIdentifierAutomobileAvoidingTraffic
for driving routes that avoid traffic congestion. (#86) - Replaced RouteStep’s
name
property with anames
property; each string in the array is a road name that was previously delimited by a semicolon. (#91) - Added a
codes
property to RouteStep that contains any highway route numbers associated with the road. These are the same route numbers that were formerly parenthesized in thename
property. (#91) - Added a
destinations
property to RouteStep that indicates a highway ramp’s signposted destination. (#63) - Added an
intersections
property to RouteStep that indicates the locations and configurations of each intersection along the step, including turn lane markings. (#80) - Added
UseLane
andTakeRotary
maneuver types, which indicate an instruction to change lanes or enter a large, named roundabout, respectively. (#93) - Fixed a crash that could occur when the user is connected to a captive network. (#71)
- Fixed a crash that occurred when a request failed due to rate limiting. (#103)
- The Route, RouteLeg, and RouteStep classes now conform to the NSSecureCoding protocol. (#68)
- Added convenience initializers to RouteLeg and RouteStep that accept a JSON dictionary formatted as the relevant part of a Mapbox Directions API response. (#92)
- The user agent string sent by the Mac version of this library now says “macOS” instead of “OS X”. (#55)
v0.6.0
This is a complete rewrite of MapboxDirections.swift that focuses on making the API more Swift-like in Swift but also adds Objective-C support (#47). The goal is no longer to be a drop-in replacement for MapKit’s MKDirections API, but the library continues to use terminology familiar to Cocoa and Cocoa Touch developers. This version includes a number of breaking changes:
- Most types and methods can now be used in Objective-C.
- Removed the
MB
class prefix from Swift but kept it for Objective-C. If any type conflicts with a type in your application’s module, prefix it withMapboxDirections.
. - Added a shared (singleton)
Directions
object. Use the shared object if you’ve set your Mapbox access token in theMGLMapboxAccessToken
key of your application’s Info.plist file. (You may have already done so if you’ve installed the Mapbox iOS SDK or Mapbox OS X SDK.) Otherwise, create aDirections
object with the access token explicitly. - Simplified the networking part of the library:
- Removed the dependency on RequestKit. If you’re upgrading to this version using CocoaPods, you can remove the
NBNRequestKit
dependency override. Directions
no longer needs to be strongly held in order for the request to finish. Instead, the request is made against the shared URL session; to use a custom URL session, make the request yourself using the URL returned by theURLForCalculatingDirections(options:)
property.- A single directions object uses the shared URL session for all requests, so it can handle multiple requests concurrently without raising an exception.
- Removed the
cancel()
method; instead, directly cancel the NSURLSessionDataTask returned bycalculateDirections(options:completionHandler:)
.
- Removed the dependency on RequestKit. If you’re upgrading to this version using CocoaPods, you can remove the
- Replaced
calculateDirectionsWithCompletionHandler(_:completionHandler:)
andcalculateETAWithCompletionHandler(_:completionHandler:)
with a singlecalculateDirections(options:completionHandler:)
method, which takes aRouteOptions
object that supports all the options exposed by the Geocoding API. If you need to use Mapbox Directions API v4, use aRouteOptionsV4
instead ofRouteOptions
. - Steps are no longer returned by default, and the overview geometry is simplified by default. If you want full, turn-by-turn directions, configure the
RouteOptions
object to include the route steps and full-resolution route shapes. If you only want the estimated travel time or distance to a destination, use the default values inRouteOptions
. - Replaced the
MBDirectionsRequest.TransportType
type with a freeformprofileIdentifier
option. Use one of the three profile identifier constants with this option. - Removed the
MBDirectionsResponse
class in favor of passing the waypoints and routes from the response directly into the completion handler. - Renamed
Route.geometry
toRoute.coordinates
. For Objective-C compatibility, there are additional methods that work with C arrays of coordinates. - Each enumeration’s raw values are integer types instead of strings, but the enumerations also conform to
CustomStringConvertible
in Swift, allowing the enumeration values to be converted to and from strings easily.
Other changes since v0.5.0:
- Added official support for OS X, tvOS, and watchOS. (#49)
- Added documentation for the entire library. You can access the documentation for any symbol using Quick Help (option-click) or Jump to Definition (command-click). (#47)
- Replaced the
TakeRamp
maneuver type withTakeOnRamp
,TakeOffRamp
, andTurnAtRoundabout
to reflect changes in OSRM v5.1.0 and Mapbox Directions API v5. (#45) - Added options to configure what’s included in the output, how close the route needs to come to the specified waypoints, and whether to include routes that U-turn at intermediate waypoints. (#47)
- Added a way to specify the heading accuracy of any waypoint. (#47)
- By default, returned routes may U-turn at intermediate waypoints. (#47)
- Various error conditions returned by the API, such as the rate limiting error, cause the localized failure reason and recovery suggestion to be set in the NSError object that is passed into the completion handler. (#47)
- Requests sent through this library now use a more specific user agent string, so you can more easily identify this library on your Statistics page in Mapbox Studio. (#50)