我一直在研究一个项目,当按下导航按钮时,它一旦转弯模式就会翻转。
当我按下“ navigateButton”时,我想翻转我的NavigationMapView(转弯视图,就像Gps一样)。我尝试从故事板上制作一个按钮,但由于应用程序中的所有内容都是代码,因此它被所有内容覆盖。
@objc func navigateButtonWasPressed(_ sender: UIButton) {
mapView.setUserTrackingMode(.none, animated: true)
UIView.animate(withDuration: 2.0,animations: {
self.mapView.transform = CGAffineTransform(scaleX: -1, y: 1)
构建后,我按下导航按钮,它不会翻转,但是我相信这是@objc而不是@IBAction是其原因。