User interface guidelines says that you shouldn't allow upside-down orientation on phones.
authorSam Lantinga <slouken@libsdl.org>
Tue, 18 Sep 2012 22:24:40 -0700
changeset 6438 2c0fa683b18c
parent 6437 3e52c17e2a07
child 6439 fbbd640d7867
User interface guidelines says that you shouldn't allow upside-down orientation on phones.
src/video/uikit/SDL_uikitviewcontroller.m
--- a/src/video/uikit/SDL_uikitviewcontroller.m	Tue Sep 18 22:24:08 2012 -0700
+++ b/src/video/uikit/SDL_uikitviewcontroller.m	Tue Sep 18 22:24:40 2012 -0700
@@ -48,6 +48,12 @@
 
 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orient
 {
+    // Don't allow upside-down orientation on the phone, so answering calls is in the natural orientation
+    if (orient == UIInterfaceOrientationPortraitUpsideDown) {
+        if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
+            return NO;
+    }
+
     const char *orientationsCString;
     if ((orientationsCString = SDL_GetHint(SDL_HINT_ORIENTATIONS)) != NULL) {
         BOOL rotate = NO;