title: MKAnnotation Swift
body: <p>I am unsure how to annotate a map in the swift language. I don't know how to create the NSObject class. The following is code I tried but was unable to run:</p>
  
  <pre><code>import Foundation
  import MapKit
  class MapPin : MKAnnotation
  {
      var mycoordinate: CLLocationCoordinate2D
      var mytitle: String
      var mysubtitle: String
  
      func initMapPin (coordinate: CLLocationCoordinate2D!, title: String!, subtitle: String!)
      {
          mycoordinate = coordinate
          mytitle = title
          mysubtitle = subtitle
      }
  }
  </code></pre>