fix orientation issues

This commit is contained in:
Diego Waxemberg
2014-10-20 21:39:40 -04:00
parent ca2fe9b0a3
commit af43539015
4 changed files with 39 additions and 3 deletions

View File

@@ -173,4 +173,26 @@ static StreamConfiguration* streamConfig;
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
NSString *deviceType = [UIDevice currentDevice].model;
if ([deviceType containsString:@"iPhone"] || [deviceType containsString:@"iPod"]) {
return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
} else {
return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
}
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
NSString *deviceType = [UIDevice currentDevice].model;
if ([deviceType containsString:@"iPhone"] || [deviceType containsString:@"iPod"]) {
return UIInterfaceOrientationPortrait;
} else {
return UIInterfaceOrientationLandscapeLeft;
}
}
@end