我目前正在使用
Pulley
在我的地图中创建一个类似抽屉的东西。我现在要做的是,当选择注释时,它会将抽屉更改为另一个抽屉。我遵循了开发人员说要在GitHub上使用的代码,但它从来都不起作用。
这是我的代码:
func mapView(_ didSelectmapView: MKMapView, didSelect view: MKAnnotationView) {
print("Annotation selected")
if let drawer = self.parent as? PulleyViewController {
let drawerContent = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "NewDrawerViewController")
drawer.setDrawerContentViewController(controller: drawerContent, animated: false)
drawer.setDrawerPosition(position: PulleyPosition.partiallyRevealed, animated: false)
}
}