Supporting iOS 4.3 to iOS 6.0

后端 未结 3 766
陌清茗
陌清茗 2020-12-21 21:29

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

3条回答
  •  生来不讨喜
    2020-12-21 22:09

    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 :)

提交回复
热议问题