The start and end points of a route, along with the planned mode of transportation.
SDKs
- iOS 6.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.2+
Framework
- Map
Kit
Declaration
class Request : NSObject
Overview
You use an MKDirections
object when requesting or providing directions. If your app provides directions, use this class to decode the URL sent to you by Maps. If you need to request directions from Apple, pass an instance of this class to an MKDirections
object. For example, an app that provides subway directions might request walking directions to and from relevant subway stations.
For apps that provide directions, you receive direction-related URLs in your app delegate’s application(_:
method. Upon receiving a URL, call the is
method of this class to determine if the URL is related to routing directions. If it is, create an instance of this class using the provided URL and extract the map items associated with the start and end points.
Note
To provide routing directions, your app must include special keys in its Info
file and be able to handle URLs sent to it by the Maps app. These keys indicate a special URL type that your app must be prepared to handle. For information about how to implement this support, see Location and Maps Programming Guide.