title: SWIFT 2 : Annotation with link to new page.
body: <p>First of all, yes. I know this question has been asked many times before but none of the solutions seem to work for me. I would like to add an arrow (symbol) to my annotation so that after I press it it opens a new page (see image).</p>
  
  <p>I can add the annotations to the map created from an Array I retrieve, but I can't seem to get the button on the annotation and so I als o can't open the new page. </p>
  
  <p>What i've got so far:</p>
  
  <pre><code> func mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -&gt; MKAnnotationView! {
  
          if annotation is MKUserLocation {
              //return nil
              return nil
          }
  
          let reuseId = "pin"
          var pinView = mapView.dequeueReusableAnnotationViewWithIdentifier(reuseId) as? MKPinAnnotationView
  
          if pinView == nil {
              //println("Pinview was nil")
              pinView = MKPinAnnotationView(annotation: annotation, reuseIdentifier: reuseId)
              pinView!.canShowCallout = true
              pinView!.animatesDrop = true
          }
  
          let button = UIButton(type: UIButtonType.DetailDisclosure) as UIButton // button with info sign in it
  
          pinView?.rightCalloutAccessoryView = button
  
  
          return pinView
      }
  </code></pre>
  
  <p>Also if I try to debug this, the code of func mapview doesn't seem to run. </p>
  
  <p>Code to create the annotation:</p>
  
  <p>func getMapAnnotations() -> [Activity] {
      var annotations:Array = Activity</p>
  
  <pre><code>    do {
          let data = NSData(contentsOfURL: NSURL(string: "http:/URL")!)
  
          let jsonData = try NSJSONSerialization.JSONObjectWithData(data!, options: NSJSONReadingOptions.MutableContainers)
  
          for anItem in jsonData as! [Dictionary&lt;String, AnyObject&gt;] {
  
              let longtitudeItem = (anItem["LONGTITUDE"] as! NSString).doubleValue;
              let latitudeItem = (anItem["LATITUDE"] as! NSString).doubleValue;
              let name = anItem["NAME"] as! String;
              let description = anItem["DESCRIPTION"] as! String;
  
              // do something with the data retrieved:
              let theSpan:MKCoordinateSpan = MKCoordinateSpanMake(0.01 , 0.01)
              // let location:CLLocationCoordinate2D = mapView.userLocation.coordinate;
              let location:CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: latitudeItem , longitude:longtitudeItem)
              let theRegion:MKCoordinateRegion = MKCoordinateRegionMake(location, theSpan)
  
              mapView.setRegion(theRegion, animated: true)
  
              let anotation = Activity(latitude: latitudeItem, longitude: longtitudeItem)
              anotation.title = name
              anotation.subtitle = description
  
              annotations.append(anotation)
  
  
          }  } catch let error as NSError {
  
              print(error)
  
      }
      return annotations }
  </code></pre>
  
  <p>Any help would be greatly appreciated, it's driving me insane!</p>
  
  <p>Kr,</p>