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

Autorotation breaks the refresh control (when app itself does not support autorotate) #17

Open
CZyMfnIPC opened this issue Jan 25, 2016 · 2 comments

Comments

@CZyMfnIPC
Copy link

My app has autorotation turned off (Portrait only).

When I pull down on the refresh control to expose the Pong view, then rotate, the Pong view will disappear and the table offset will still be there.

When I try to pull down again, nothing happens, when I let go, the Pong view shows up again and closes, causing the table offset to go back to normal.

My solution, remove the NotificationCenter observer for changeOrientation because I will never need it. Perhaps in the future a property can be created in BOZPongRefreshControl to enable/disable the autorotation code after initializing it.

@CZyMfnIPC
Copy link
Author

It appears that this behavior is on simulator. (because the touch is lost while rotated). On a device the Pong view flashes when the device is rotated.

We did have a crash in production, which is what brought this to our attention. I will still be disabling the rotation notification to prevent and further possible crashes.

@CZyMfnIPC
Copy link
Author

[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];

This line may be the cause of multiple crashes in production. I have seen device change notifications crashing my app on random view controllers, and I was wondering how when none of my code references or listens for orientation changes.

I also found this in the apple docs "You may nest calls to this method safely, but you should always match each call with a corresponding call to the endGeneratingDeviceOrientationNotifications method."'

Perhaps there should be an endGeneratingDeviceOrientationNotifications call in dealloc?

Example: https://pragmapilot.wordpress.com/2014/02/26/being-aware-of-device-rotations-in-hidden-uiviewcontrollers/

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

No branches or pull requests

1 participant