添加模态popup到地图注释 – Swift 3.0
我在地图上有一些自定义的引脚,当用户点击一个引脚,然后在Callout View
上的button,我会添加一个function,使用场景基座启动Modal Popup
这是我的代码:
func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, calloutAccessoryControlTapped control: UIControl) { // here I would like to launch a Modal Popup using Scene Dock popInfo.center = view.center popInfo.transform = CGAffineTransform(scaleX: 0.8, y: 1.2) self.view.addSubview(popInfo) UIView.animate(withDuration: 0.3, delay: 0, usingSpringWithDamping: 0.5, initialSpringVelocity: 0, options: [], animations: { self.dimView.alpha = 0.8 self.popInfo.transform = .identity }) }
谢谢