I'm working on making an app using MapKit. I want to have one "pinchable" and "pannable" overlay. So I use UIViews as the MapKit overlays do not seem to works well with gesture recognizers. In the storyboard I set constrains of the UIVIew to have a fixed size, and centered on the map. I have set gesturesRecognizers to the UIView. All works well until I rotate the device. The UIVIew loses it's pinched Scale and pan new location.
I have used this function
"func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) { coordinator.animateAlongsideTransition(nil, completion: { //Your code }"
I can use it to relocate and resize the UIView. It works.
The only problem is that the automatic resizing and relocating of the UIVIew happens after this function has done it's work. So the UIVIew always return to the position ans size forced by the constraints.
I have searched every where how to prevent a pinched/panned view from returning to the constraints values after device rotation but no lock.
Help would be greatly appreciated.
Thanks in advanceI