0

I am a beginner, and i can't understand one thing. In this example there exist Info button. As I understand there piece of code returns this button:

  func mapView(_ mapView: MGLMapView, rightCalloutAccessoryViewFor annotation: MGLAnnotation) -> UIView? {
    return UIButton(type: .detailDisclosure)
}

So the question is: how can I open another View (view name: extraInfo, viewcontroller's name: extraInfoController) from this button programmatically? Please, can u reply in detail, because as i already sad, I am beginner. :) (I am using Swift, not Obj-C)

Kirill
  • 7
  • 1

1 Answers1

1

You can use this delegate method

func mapView(_ mapView: MGLMapView, annotation: MGLAnnotation, calloutAccessoryControlTapped control: UIControl) {

}
Sivajee Battina
  • 4,124
  • 2
  • 22
  • 45
  • Would you be able to answer a little more in detail? How can I open new View? Srry for this questions, but I am beginner and trying to understand this thing) – Kirill Apr 09 '17 at 11:45
  • If you want to present view from this, you have to use this: self.presentViewController(VC, animated: true, completion: nil). Here VC is view controller which you can present – Sivajee Battina Apr 09 '17 at 11:55
  • If you are unaware of presenting view controller. This link may helpful http://stackoverflow.com/questions/24099533/swift-presentviewcontroller – Sivajee Battina Apr 09 '17 at 11:57