If you have ever owned an iPhone and used Apple Maps, you will be familiar with pins. When you have a map inside of your app, having custom pins (annotations) gives your app a bit more polish. Let's create our custom annotations.
Open up MapViewController in the Navigator Panel, then inside of the initialize() method, add the following:
mapView.delegate = self
Next, add the following directly under the addMap(_ annotations:) method:
func mapView(_ mapView:MKMapView, viewFor annotation:MKAnnotation) -> MKAnnotationView? { let identifier = "custompin" guard !annotation.isKind(of: MKUserLocation.self) else { return nil } var annotationView: MKAnnotationView? if let customAnnotationView = mapView.dequeueReusableAnnotationView(withIdentifier: ...