title: Selecting the object at index in a MapView in SWIFT
body: <p>I am trying to present another view controller once the right callout button is pressed but it must go to the correct indexPath, similar to how this happens in a table view. this is where I am up to:</p>
  
  <p>I have created a custom annotation like so:</p>
  
  <pre><code>class annotationCustom: NSObject, MKAnnotation {
  
      var coordinate : CLLocationCoordinate2D
      var title : NSString!
      var subtitle : NSString!
      var isUserAnnotation : Bool
      var dataImage = [NSData]()
  
      init(coordinate: CLLocationCoordinate2D, title: NSString!, subtitle: NSString!){
  
          self.coordinate = coordinate
          self.title = title
          self.subtitle = subtitle
          self.isUserAnnotation = false
      }
  }
  </code></pre>
  
  <p>and then set the <code>viewForAnnotation</code> like so:</p>
  
  <pre><code>func mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -&gt; MKAnnotationView! {
  
          var dqPin = "pin"
  
          var view = mapView.dequeueReusableAnnotationViewWithIdentifier(dqPin) as? MKPinAnnotationView
  
                  view = MKPinAnnotationView(annotation: annotation, reuseIdentifier: dqPin)
                  view!.canShowCallout = true
  
                      var arrowBut = UIImage(named: "arrow")
                      var arrowButton = UIButton()
                      arrowButton.setImage(arrowBut, forState: UIControlState.Normal)
                      arrowButton.tintColor = UIColor.blackColor()
                      arrowButton.frame = CGRectMake(0, 0, 30, 30)
                      view!.rightCalloutAccessoryView = arrowButton
                     }
               return view
               }
  </code></pre>
  
  <p>Now I know I have to use the function: </p>
  
  <pre><code>func mapView(mapView: MKMapView!, annotationView view: MKAnnotationView!, calloutAccessoryControlTapped control: UIControl!) {
              func mapView(mapView: MKMapView!, annotationView view: MKAnnotationView!, calloutAccessoryControlTapped control: UIControl!) {
  
          if control == view.rightCalloutAccessoryView {
  
          let sb = UIStoryboard(name: "Main", bundle: nil)
          let userProfileVC = sb.instantiateViewControllerWithIdentifier("usersProfileVC") as UsersProfilesViewController
  
                  userProfileVC.profileName = annotationCustom.title // error: 'annotationCustom.Type' does not have a member named 'title'
  
          performSegueWithIdentifier("goToUserFromMap", sender: self)
      }
  
  }
  </code></pre>
  
  <p>} </p>
  
  <p>Can somebody fill in the gaps or help me out please.</p>
  
  <p>Thanks</p>