MkMapView drop a pin on touch

后端 未结 2 1552
一个人的身影
一个人的身影 2021-02-07 16:16

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:11

    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.

提交回复
热议问题