MkMapView drop a pin on touch

后端 未结 2 1958
情歌与酒
情歌与酒 2021-02-07 16:28

I am struggling to unearth a standard way to drop a pin on a MkMapView based on a touch input. There probably isnt a standard way, but it is always worth asking. If I have to im

2条回答
  •  耶瑟儿~
    2021-02-07 17:13

    Yes, you can use a UILongPressGestureRecognizer to do this.

    This previous answer of mine has details with sample code:
    How to add a push pin to a MKMapView(IOS) when touching?

    To animate the drop, in viewForAnnotation, return an MKPinAnnotationView with animatesDrop set to YES.

提交回复
热议问题