Swift - Add MKAnnotationView To MKMapView

后端 未结 3 639
野的像风
野的像风 2020-11-30 04:13

I\'m trying to add MKAnnotationView to MKMapView but I can\'t do it… Can anyone help me?

Here is my code:

override func vie         


        
3条回答
  •  误落风尘
    2020-11-30 04:36

    You have to show annotation, then you have to add the show annotation method:

    let annotation = MKPointAnnotation()
    mapVew.showAnnotations([annotation], animated: true)
    

    annotation is an instance of MKPointAnnotation.

提交回复
热议问题