I have view structure like below.
HomeView(Support only portrait mode)
|
|
V
View1(Support all orientation)
|
|
V
View2(Support all orientation)
Problem :
When i am coming back from View2(Landscape mode)
to HomeView
by calling popToRootViewController
method,It did not call supportedInterfaceOrientationsForWindow
method of App_Delegate and display
HomeView in landscape mode
.
Image:
Note :
Same thing not happens when i came back from View1(Landscape mode) to HomeView by calling popToRootViewController method
it will call supportedInterfaceOrientationsForWindow and all works great.
If I run app using XCode6 in iOS7 all works great.
I read below question but it did not help me
.
How to maintain presenting view controller's orientation when dismissing modal view controller?
In above link matt
said that iOS8 stop support for friezing orientation
, but I did not find it in apple document
if you have any reference link
about this change please share.
Question :
1] Why delegate method supportedInterfaceOrientationsForWindow is not calling.
2] Is it possible to have one view with support single orientation and all other will support all orientation.
Thanks
I solve it and post answer as it will may help some one
Problem :
I have below code in supportedInterfaceOrientationsForWindow.
But
delegate
methodsupportedInterfaceOrientationsForWindow
not called when usepopToRootViewControllerAnimated
method when there ismore then two view Cotnrollers
exists in stack.Solution :
Step1: Create sub class of Navigation controller.
Step2: Override method popToRootViewControllerAnimated and write code as below // Overwrite super class method popToRootViewControllerAnimated.
Please fill free for any comments and ask for any questions.