From 1ab7a260ebd670de73e6ee0ad6f60456a0a18244 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 18 Sep 2012 22:24:40 -0700 Subject: [PATCH] User interface guidelines says that you shouldn't allow upside-down orientation on phones. --- src/video/uikit/SDL_uikitviewcontroller.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index 8c21e6f32..b42c09a97 100755 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -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;