I use viewWillTransitionToSize to adjust my output menu when I rotate the device, however it seems to be split into Swift 3? Can anyone solve this for me? My code is as follows:
func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) { super.viewWillTransition(to: size, with: coordinator) coordinator.animate(alongsideTransition: nil, completion: { _ in let controller = self.revealViewController().rightViewController var frame = controller?.view.frame frame?.size.height = UIScreen.main.bounds.size.height - self.navigationController!.navigationBar.frame.size.height - self.toolBar.frame.size.height - (UIApplication.shared.isStatusBarHidden ? 0 : 20) controller?.view.frame = frame! }) }
Doesn't it seem to be called when I rotate the device?
ios swift swift3
Recusiwe
source share