UIButton、Mapbox、以编程方式打开新视图
UIButton, Mapbox, Open new View programmatically
我是初学者,有一样东西是看不懂的。
在这个 example 中有信息按钮。据我了解,有一段代码 returns 这个按钮:
func mapView(_ mapView: MGLMapView, rightCalloutAccessoryViewFor annotation: MGLAnnotation) -> UIView? {
return UIButton(type: .detailDisclosure)
}
所以问题是:如何以编程方式从此按钮打开另一个视图(视图名称:extraInfo,viewcontroller 的名称:extraInfoController)?
拜托,你能详细回复吗,因为我已经很伤心了,我是初学者。 :)
(我使用的是 Swift,不是 Obj-C)
你可以使用这个委托方法
func mapView(_ mapView: MGLMapView, annotation: MGLAnnotation, calloutAccessoryControlTapped control: UIControl) {
}
我是初学者,有一样东西是看不懂的。 在这个 example 中有信息按钮。据我了解,有一段代码 returns 这个按钮:
func mapView(_ mapView: MGLMapView, rightCalloutAccessoryViewFor annotation: MGLAnnotation) -> UIView? {
return UIButton(type: .detailDisclosure)
}
所以问题是:如何以编程方式从此按钮打开另一个视图(视图名称:extraInfo,viewcontroller 的名称:extraInfoController)? 拜托,你能详细回复吗,因为我已经很伤心了,我是初学者。 :) (我使用的是 Swift,不是 Obj-C)
你可以使用这个委托方法
func mapView(_ mapView: MGLMapView, annotation: MGLAnnotation, calloutAccessoryControlTapped control: UIControl) {
}