Screen rotation make gestures invalid

When the screen orientation changed, the UIPanPressGestureRecognizer state will always be changed to UIGestureRecognizerStateCancelled and make this gesture invalid.

  Of course i shoud show the code, but i think this code is too short so it can not be the key of this problem.I'll try to describe it as best I can.

  Think about it: A UIScrollView in a APP and this APP allow landscape mode, now you are dragging this UIScrollView and rotate your iPhone screen to landscape at the same time, remember you are always keeping your finger pressing in the screen, then you will see that your dragging is cancelled when the rotate animation of the UIScrollView is showing, but now your finger is still pressing in that screen.

  Then i found those gestures in the Photos didn't, when i was dragging the listview of photos(i think it is a UICollectionView) and rotated my iPhone, the screen orientation will no be changed Immediately unless i stopped my dragging.

  1.enabled the switch of screen rotation and launch the Photos

  2.rotated the screen to landscape and now views were not be rotated

  3.left finger from the screen

  So how can we do to freeze the screen rotating until get our finger out of the screen.

  Is there any way of avoiding this? Or is there some other approach of doing it?Thank you very much!

Replies

Can someone help me?

Maybe the Photos have some private APIs to control the state of screen rotation?

It may be that iPhotos simply prevents rotation when a touch begins. For example, a view controller may return "false" from "shouldAutorotate" between the beginning and end of a touch. However, no one here can really help you find out whether iPhotos actually does something hacky or private.


For something like this, I would suggest using a TSI on your developer account, to get a definitive answer from an Apple engineer about whether your goal is achievable with public API. Anything else is just guesswork.

Thanks for your help, i will try this TSI