Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autorotate for all but one VC? #687

Open
victorengel opened this issue Nov 22, 2021 · 1 comment
Open

Autorotate for all but one VC? #687

victorengel opened this issue Nov 22, 2021 · 1 comment

Comments

@victorengel
Copy link

Submitting as a feature request because there's no how-to category. Possibly it's possible to already do this.

SideMenu currently meets the majority of people's needs with the features it already has. However, this is a great opportunity for you to join the proud members who have contributed to this open source project! Feel free to open an issue to ask any clarifying questions for your new feature before you start building. Open a pull request when you're ready for me to merge it.

Describe the solution you'd like
I have several view controllers controlled by the side menu. One of them should not rotate when the device rotates. Why? Because it uses the accelerometer to animate things based upon gravity. It is full screen.

Ask any questions you have related to developing your solution
When I first started using side menu, the above mentioned feature was the main feature I wanted to use. I solved the issue by making the app portrait-only. I did several things to make this work. I think the one that finally worked was to implement shouldAutoRotate in my main ViewController, returning false. In the child VC in question, I also implemented supportedInterfaceOrientations and returned .portrait for that.

Unfortunately, even with that set, if I set shouldAutoRotate to true in the main VC, the child rotates even though I have supportedInterfaceOrientations set to .portrait only.

Now I want to support rotation for the other VCs, but I don't want to mess this one up. Is there some trick to make this work?

@leo150
Copy link

leo150 commented Jun 22, 2022

shouldAutoRotate is called before the orientation update. You can ask top child if it does support rotation or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants