Is there a way to register tapgesture within the image of MKAnnotationView
?
有没有办法在MKAnnotationView的图像中注册tapgesture?
Basically my anotation view looks like this, it has no title, no subtitle, only custom image, and I would like to stay it that way if possible:
基本上我的anotation视图看起来像这样,它没有标题,没有副标题,只有自定义图像,如果可能的话我想保持这种方式:
My current test MKAnnotationView
我目前的测试MKAnnotationView
I would like to navigate to a different viewcontroller when tapped inside the image or show a TableView from the bottom of the screen. For now I really just need to see how to register tapped gesture inside so I can move forward with the functionality.
我想在图像内部轻敲时导航到另一个视图控制器,或者从屏幕底部显示一个TableView。现在我真的只需要看看如何在里面注册tapped手势,这样我就可以继续使用这个功能了。
Cheers.
1 个解决方案
#1
1
You can use didSelect
method.
您可以使用didSelect方法。
e.g.
func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
// navigate to a different viewcontroller
// or show a TableView from the bottom of the screen
}
#1
1
You can use didSelect
method.
您可以使用didSelect方法。
e.g.
func mapView(_ mapView: MKMapView, didSelect view: MKAnnotationView) {
// navigate to a different viewcontroller
// or show a TableView from the bottom of the screen
}