0

I'm using Swift 2 in Legancy language version. The problem is that i can't detect orientation changes with this code :

override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
    super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator);

    if size.height<size.width {
        print("Landscape");
    } else {
        print("Portrait");
    }
}

that works until a few weeks ago. how can i fix it?

WillyWon
  • 15
  • 3

0 Answers0