title: Swift different images for Annotation
body: <p>I managed to get a custom icon for a annotation pin in Swift, but now I am still stuck using 2 different images for different annotations. Right now a button adds a annotation to the map.  There should be another button that also adds a annotation but with another icon.</p>
  
  <p>Is there a way to use the reuseId for this?</p>
  
  <pre><code>class ViewController: UIViewController, MKMapViewDelegate {
  
  @IBOutlet weak var Map: MKMapView!
  
  @IBAction func btpressed(sender: AnyObject) {
  
      var lat:CLLocationDegrees = 40.748708
      var long:CLLocationDegrees = -73.985643
      var latDelta:CLLocationDegrees = 0.01
      var longDelta:CLLocationDegrees = 0.01
  
      var span:MKCoordinateSpan = MKCoordinateSpanMake(latDelta, longDelta)
      var location:CLLocationCoordinate2D = CLLocationCoordinate2DMake(lat, long)
      var region:MKCoordinateRegion = MKCoordinateRegionMake(location, span)
  
      Map.setRegion(region, animated: true)
  
  
      var information = MKPointAnnotation()
      information.coordinate = location
      information.title = "Test Title!"
      information.subtitle = "Subtitle"
  
      Map.addAnnotation(information)
  }
  
  func mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!) -&gt; MKAnnotationView! {
      if !(annotation is MKPointAnnotation) {
          return nil
      }
  
      let reuseId = "test"
  
      var anView = mapView.dequeueReusableAnnotationViewWithIdentifier(reuseId)
      if anView == nil {
          anView = MKAnnotationView(annotation: annotation, reuseIdentifier: reuseId)
          anView.image = UIImage(named:"1.png")
          anView.canShowCallout = true
      }
      else {
          anView.annotation = annotation
      }
  
      return anView
  }
  </code></pre>