As the title says, I am creating a map application with MKMap, but I really need to rotate the map with a button, so I am having a hard time because I don't understand that part.I will post the code I tried, thank you.
let maxWidth: CGFloat=self.view.bounds.width
let maxHeight —CGFloat=self.view.bounds.height
myMapView.frame = CGRect (x:0, y:70, width:maxWidth, height:maxHeight-20.0-50.0)
letangle: CGFloat=CGFloat(30.0*Double.pi)/180.0)
myMapView.transform = CGAffineTransform (rotationAngle:angle)
self.view.addSubview(myMapView)
myMapView.camera.heading+=10
It's done with
© 2024 OneMinuteCode. All rights reserved.