# mapKit not display annotation

**URL:** <https://forums.kodeco.com/t/mapkit-not-display-annotation/25559>\
**Category:** Swift\
**Created:** [January 24, 2017, 10:46pm UTC](https://forums.kodeco.com/t/mapkit-not-display-annotation/25559 "2017-01-24T22:46:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zalubski](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/zalubski/32/81494_2.png) [@zalubski](https://forums.kodeco.com/u/zalubski)\
**Post date:** [January 24, 2017, 10:46pm UTC](https://forums.kodeco.com/t/mapkit-not-display-annotation/25559/1 "2017-01-24T22:46:18Z")

</div>

My code is not displaying the title or subtitle of the each pins. The pins appear on there coordinates. However when clicking on the pins nothing appears. I would just like the pins to be different colors and when clicked on they display a message.

```
   import UIKit
import MapKit

 class MyPointAnnotation : MKPointAnnotation {
   var pinTintColor: UIColor?
  }

   class ViewController: UIViewController, MKMapViewDelegate {
     @IBOutlet var jmap: MKMapView!

   override func viewDidLoad() {
    super.viewDidLoad()

jmap.delegate = self

let hello = MyPointAnnotation()
hello.coordinate = CLLocationCoordinate2D(latitude: 40, longitude: -73)
hello.title = "My Shop"
hello.subtitle = "its cool"
hello.pinTintColor = .red

let hellox = MyPointAnnotation()

hellox.coordinate = CLLocationCoordinate2D(latitude: 34, longitude: -72)

hellox.title = "NOW"

hellox.title = "JUdo"
hellox.pinTintColor = .blue

jmap.addAnnotation(hello)
jmap.addAnnotation(hellox)
   }

 func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
var annotationView = mapView.dequeueReusableAnnotationView(withIdentifier: "myAnnotation") as? MKPinAnnotationView

if annotationView == nil {
    annotationView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: "myAnnotation")
} else {
    annotationView?.annotation = annotation
}

if let annotation = annotation as? MyPointAnnotation {
    annotationView?.pinTintColor = annotation.pinTintColor

}
return annotationView
}}

```

---

<div class="post-metadata">

**Author:** ![aeberbach](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/aeberbach/32/81494_2.png) [@aeberbach](https://forums.kodeco.com/u/aeberbach)\
**Post date:** [January 25, 2017, 3:06am UTC](https://forums.kodeco.com/t/mapkit-not-display-annotation/25559/2 "2017-01-25T03:06:50Z")

</div>

Please, just[one topic per problem](https://forums.kodeco.com/t/how-to-change-a-pin-color-in-swift-3-using-map-kit/25454/3). Did you read my last reply and try to step through with a debugger?
