Hi,
I'm trying to implement orientation rotation lock / unlock toggle switch to my iOS app.
Locking is OK, but unlocking is a problem.
Suppose a situation that app's orientation and device's orientation are differ. If user unlocks in the situation, app's orientation should follow device's orientation immediately. But I cannot find the way.
How can I simulate device's orientation rotation?
Edit
I'll clarify the situation.
There is a toggle switch in app, enable/disable orientation rotation.
Step by step:
1. The switch is enabled.
2. Device rotates to portlait.
3. UIViewController's shouldAutorotateToInterfaceOrientation returns YES for every orientation.
4. App rotates to portlait.
5. User toggles the switch to disable.
6. Device rotates to landscape.
7. UIViewController's shouldAutorotateToInterfaceOrientation returns NO except portlait.
8. App doesn't rotate.
9. User toggles the switch to enable.
10. App should rotate to landscape. This is the problem.