OK。私はこれを行う方法を考え出した。
私はマーカーを "あらかじめ選択"しています。これは、私の場合は大したことではないが、私が欲しいものを私に与える単純なコールアウトを行うことができないことを意味します。
更新日:コードまたはそれは発生しませんでした。
私はMKMapViewDelegate機能のカップルを追加しました:私はマップを設定するとき
/* ################################################################## */
/**
This responds to the map's region being changed.
We simply use this to "preselect" the marker, so there's no need for two taps.
- parameter mapView: The MKMapView object that contains the marker being moved.
- parameter animated: True, if the change was animated.
*/
func mapView(_ mapView: MKMapView, regionDidChangeAnimated animated: Bool) {
self.mapView.selectAnnotation(self._meetingMarker, animated: false)
}
/* ################################################################## */
/**
This responds to the marker's selection turning off.
We simply use this to "preselect" the marker, so there's no need for two taps.
- parameter mapView: The MKMapView object that contains the marker being moved.
- parameter didDeselect: The annotation view (it's ignored. We always select our marker).
*/
func mapView(_ mapView: MKMapView, didDeselect view: MKAnnotationView) {
self.mapView.selectAnnotation(self._meetingMarker, animated: false)
}
最初が呼び出され、そして何かが選択をオフにしようとするたび秒が呼び出されます。
注:これは、単一のマーカーを持つマップにのみ適しています。