MKMapItem
A point of interest on the map.
Declaration
class MKMapItemMentioned in
Overview
A map item includes a geographic location and any interesting data that might apply to that location, such as the address at that location and the name of a business at that address. You can also create a special MKMapItem object representing the user’s location.
Use this class to do the following:
Share map-related data with the Maps app.
Handle requests for directions that originate from the Maps app.
To display information in the Maps app, create an MKMapItem object with the information you want to display and call the openMaps(with:launchOptions:) method. The Maps app displays that location on the map and shows the information you provide.
If you implement a routing app, the Maps app provides two MKMapItem objects representing the start and end points. Use the information in those two objects to plot the route and generate directions.
Topics
Creating map items
Accessing the map item attributes
MKMapItem.IdentifieralternateIdentifiersidentifierisCurrentLocationnameplacemarkpointOfInterestCategoryphoneNumbertimeZoneurl
Launching the Maps app
openMaps(with:launchOptions:)openMaps(with:launchOptions:completionHandler:)openMaps(with:launchOptions:from:completionHandler:)openInMaps(launchOptions:)openInMaps(launchOptions:completionHandler:)openInMaps(launchOptions:from:completionHandler:)