Getting directions between source and destination locations is one of the common operations when dealing with maps and navigation apps. You can get directions from the current location or any other source location to the destination location and those directions will differ depending on the mode of transit, such as walking, driving, cycling, or public transport. In this section, we will learn how to get the direction between any two source and destination points and display them on the map.
To get directions between a source and destination, perform the following steps:
Let's continue using our demo to add a way to display directions between two locations.
Go to storyboard and open our view controller to add a UIButton at the bottom with the title
Directions. Add constraints to the button to stick it to the bottom, like this:
didClickOnDirections, to the button in