Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why shouldAutorotateToInterfaceOrientation method marked as unavailable?

I put this code to a UIViewController subclass:

override func shouldAutorotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation) -> Bool {
    return true
}

and I get this compile time error:

Cannot override 'shouldAutorotateToInterfaceOrientation' which has been marked unavailable

What is the problem and how do I solve this?

like image 788
szuniverse Avatar asked Dec 15 '22 14:12

szuniverse


1 Answers

shouldAutorotateToInterfaceOrientation is deprecated try using shouldAutorotate()

like image 152
Boid Avatar answered Apr 30 '23 18:04

Boid