override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { let deviceOrientation = UIDevice.current.orientation if UIDeviceOrientationIsPortrait(deviceOrientation) { // } else if UIDeviceOrientationIsLandscape(deviceOrientation) { // } }