【问题标题】:Detecting the tap which changes the selected annotation or deselects it检测更改所选注释或取消选择它的点击
【发布时间】:2017-09-09 12:00:24
【问题描述】:

我基本上是在尝试检测何时取消选择注释。因此,当您单击另一个注释并更改当前选定的注释时,或者当您仅点击地图并取消选择它时。

【问题讨论】:

    标签: ios swift swift3 mkannotation


    【解决方案1】:

    为此有一个委托方法。只需确保将地图视图的 delegate 属性设置为包含视图控制器即可。

    optional func mapView(_ mapView: MKMapView, didDeselect view: 
    MKAnnotationView)
    

    此链接可能对您有所帮助:https://developer.apple.com/documentation/mapkit/mkmapviewdelegate

    【讨论】:

      猜你喜欢
      • 2021-04-05
      • 1970-01-01
      • 2022-01-18
      • 1970-01-01
      • 2014-12-05
      • 1970-01-01
      • 2011-07-05
      • 2016-10-31
      • 2011-02-25
      相关资源
      最近更新 更多