Example to get location using MapKit.
This example of MapKit implementation gives the basic idea of how to use its framework.
The application asks for user permisssion to access user current location. Once user allows the access to location, you can see your current location. It also allows user to search for different locations using UISearchController and displays pin on selected location on MapView.
Reference: To read more about MapKit https://developer.apple.com/documentation/mapkit .