[英]UIButton, Mapbox, Open new View programmatically
I am a beginner, and i can't understand one thing. 我是一个初学者,我听不懂一件事。 In this example there exist Info button.
在此示例中 ,存在“信息”按钮。 As I understand there piece of code returns this button:
据我了解,有一段代码返回此按钮:
func mapView(_ mapView: MGLMapView, rightCalloutAccessoryViewFor annotation: MGLAnnotation) -> UIView? {
return UIButton(type: .detailDisclosure)
}
So the question is: how can I open another View (view name: extraInfo, viewcontroller's name: extraInfoController) from this button programmatically? 所以问题是:如何从该按钮以编程方式打开另一个View(视图名称:extraInfo,viewcontroller的名称:extraInfoController)? Please, can u reply in detail, because as i already sad, I am beginner.
请您详细答复一下,因为我已经很伤心了,我是初学者。 :) (I am using Swift, not Obj-C)
:)(我使用的是Swift,而不是Obj-C)
You can use this delegate method 您可以使用此委托方法
func mapView(_ mapView: MGLMapView, annotation: MGLAnnotation, calloutAccessoryControlTapped control: UIControl) {
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.