I already have the base code that supports ios 4.3 to ios 5. Now I would also like to support ios 6.0.
The present base code has modal views
, hard coded
Yes it is perfectly fine and can be done to support ios 4.3 to ios 6.0 using the xcode 4.5.
And for the orientations in ios 6 have to do some work around like have to put some code differently as posted in @Mayur J's answer.
Or all you can do is just add categories for the required controller's like UINavigationController
, UIPopoverViewController
, UIImagePickerViewController
, etc to return the supported orientation in ios 6.0 like below
.h file
#import
@interface UIPopoverController (UIPopoverController_Orientation)
-(NSUInteger) supportedInterfaceOrientations;
@end
.m file
#import "UIPopoverController+UIPopoverController_Orientation.h"
@implementation UIPopoverController (UIPopoverController_Orientation)
-(NSUInteger) supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscape;
}
@end
Here I use UIInterfaceOrientationMaskLandscape
as I only supports landscape orientations ie restrict my app to only landscape mode.
Hope this will help you.
Happy Coding :)