ios - supportedInterfaceOrientations is not called in my controller -
i have complex problem (or think). i'm working on legacy application fixing issues, , making support 4 inch displays , ios 7. problem app's architecture quiet complex, several categories , method swizzling implement custom , feel in ios 4.3 , 5.
the application related financial markets , stock exchanges. app designed being navigated in portrait orientation only, except couple of controllers, tilting phone change view chart of stock/market. whole app has 1 uinavigationcontroller
, , in many places, uitabbarcontroller
s. in controller i'm interested in, structure follows:
uinavigationcontroller
- orientation controller changes view if orientation changed
uitabbarcontroller
having severaluiviewcontrollers
- market/stock controller in first slot of
uitabbarcontroller
- market/stock controller in first slot of
- chart controller
- orientation controller changes view if orientation changed
this structure used work this. when phone tilted, shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation
(this pre ios 6) called on orientation controller (that has both uitabbarcontroller
, chart controller), , checks if selectedindex
of uitabbarcontroller
1 market controller, or stock controller, replaces view chart view landscape orientation.
after ios 6, supportedinterfaceorientations
, shouldautorotate
added our code, , worked fine well. however, after upgrading xcode 5 , building ios 7 base sdk, shouldautorotate
not being called on orientation controller, it's being called on both uitabbarcontroller
, market/stock controller.
any ideas?
subclass navigation controller , override method:
// customnavigationcontroller.m - (bool)shouldautorotate { return [self.topviewcontroller shouldautorotate]; }
then add shouldautorotate
method viewcontroller should rotated , return yes:
// viewcontroller.m - (bool)shouldautorotate { return yes; }
Comments
Post a Comment