There is an undocumented method to force rotation in code. While this will work for tests, it could get your app rejected if you use it in a submitted app:
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight animated:YES];
Just include this category wherever you need to use this method:
@interface UIDevice (MethodsThatAppleWillHitMeWithTheBanStickForUsing)
-(void)setOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated;
-(void)setOrientation:(UIInterfaceOrientation)orientation;
@end
StackOverflow
[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight animated:YES];
Just include this category wherever you need to use this method:
@interface UIDevice (MethodsThatAppleWillHitMeWithTheBanStickForUsing)
-(void)setOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated;
-(void)setOrientation:(UIInterfaceOrientation)orientation;
@end
StackOverflow
Comments
Post a Comment