Add Modal Popup to Map Annotation - Swift 3.0

你说的曾经没有我的故事 提交于 2019-12-17 14:58:17

问题


I have a number of custom pins on a map and when a user taps a pin and then the button on the Callout View I would would to add a function that launches a Modal Popup using Scene Dock

Here is my code:

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
       })
}

Thanks

来源:https://stackoverflow.com/questions/46717839/add-modal-popup-to-map-annotation-swift-3-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!