openInMaps(launchOptions:)
Opens the Maps app and displays the map item.
Declaration
func openInMaps(launchOptions: [String : Any]? = nil) -> BoolParameters
- launchOptions:
Additional information that the Maps app can use to configure the map display. For example, you can use the launch options to specify the visible map region and the map type. For a list of keys you can put into this dictionary, see Launch Options Dictionary Keys.
This parameter may be
nil.
Return Value
true if the Maps app successfully opens the map item, or false if there’s an error.
Discussion
You use this method to pass the map item to the Maps app. If your map item contains descriptive information about the location (such as a name or URL), the Maps app displays that information at the specified coordinate.
If you specify the MKLaunchOptionsDirectionsModeKey option in the launchOptions dictionary, the Maps app interprets that as an attempt to map from the user’s current location to the location that the map item specifies.
If you don’t include the MKLaunchOptionsMapCenterKey and MKLaunchOptionsMapSpanKey keys in your launchOptions dictionary, the Maps app constructs a region around the map item. It uses that region to set the visible portion of the map.