iOS16 - shouldAutorotate Deprecated, objective c - please help!

Hello,I am have trouble trying to update our app from relying on 'shouldAutorotate'.

Currently, the 'shouldAutorotate' updated the location and size of some items in the current view depending on the orientation of the device.

In iOS16, shouldAutorotate is deprecated and I have reviewed the docs, but I am soooo confused, can anyone help? Any examples on how to implement this???

Replies

What your describing is the kind of thing we would expect you to do in -[UIView layoutSubview], -[UIViewController viewWillLayoutSubviews] or -[UIViewController viewDidLayoutSubviews]. -[UIViewController shouldAutorotate] was intended to be VERY fast and only return YES/NO based on if we should autorotate the view controller at the time it was called (which was also why it was deprecated, as it was often misunderstood and difficult to use properly).

  • Could not agree more, deprecate shouldAutorotate is a bad idea!

Add a Comment

Hi @ringcewind,

(which was also why it was deprecated, as it was often misunderstood and difficult to use properly).

I think that it is an impertinence from Apple to change something like that! As a programmer I invest a lot of time to set certain layout to a certain orientation. I pay 100€/year fees to Apple, then I can also expect that for this also a solution is provided. It can not be that an app that has worked properly for several years, now no longer works with iOS-16.

I request a sample code that shows how it should work from iOS-16.

Ciao, Filippo

  • Could not agree more, deprecate shouldAutorotate is a bad idea!

Add a Comment