summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosviewcontroller.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/ios/qiosviewcontroller.mm')
-rw-r--r--src/plugins/platforms/ios/qiosviewcontroller.mm26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qiosviewcontroller.mm b/src/plugins/platforms/ios/qiosviewcontroller.mm
index 5381b3a21e..8b1a085cc5 100644
--- a/src/plugins/platforms/ios/qiosviewcontroller.mm
+++ b/src/plugins/platforms/ios/qiosviewcontroller.mm
@@ -43,12 +43,32 @@
@implementation QIOSViewController
-- (BOOL)shouldAutorotate
+-(id)init
{
- return NO;
+ self = [super init];
+ if (self) {
+ m_shouldAutorotate = NO;
+ }
+ return self;
}
-- (NSUInteger)supportedInterfaceOrientations
+-(bool)rotateToDeviceOrientation
+{
+ if ([UIViewController respondsToSelector:@selector(attemptRotationToDeviceOrientation)]) {
+ m_shouldAutorotate = YES;
+ [UIViewController attemptRotationToDeviceOrientation];
+ m_shouldAutorotate = NO;
+ return true;
+ }
+ return false;
+}
+
+-(BOOL)shouldAutorotate
+{
+ return m_shouldAutorotate;
+}
+
+-(NSUInteger)supportedInterfaceOrientations
{
// We need to tell iOS that we support all orientations in order to set
// status bar orientation when application content orientation changes.