muthukumar
muthukumar

Reputation: 649

NavigationController willRotateToInterfaceOrientation is not getting called if i change the orientation of the topviewcontroller in iOS 8

My app is navigation based one. I have extended UINavigationController and have implementations of the below methods in NavigationController and individual ViewControllers also.

-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration -(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation

When the orientation change happens In iOS 7, First Rotation method from Navigation controller gets called then the same method from Actual viewcontroller gets called. I badly need this.

In case of iOS8 only Rotation method from Viewcontroller gets called not the Navigation controllers one.

Note: I m not using any ios 8 specific orientation method also. As i have change so many things.So please don't suggest me to implement the below - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id )coordinator

Upvotes: 0

Views: 733

Answers (1)

Priyatham51
Priyatham51

Reputation: 1884

That method is deprecrated from ios 8

Sent to the view controller before performing a one-step user interface rotation.

Use viewWillTransitionToSize:withTransitionCoordinator: to make interface-based adjustments.

- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
                                         duration:(NSTimeInterval)duration

Also note that by the time we recevice this notification the view is already change to its new orientation.

For more reference https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/index.html#//apple_ref/occ/instm/UIViewController/willAnimateRotationToInterfaceOrientation:duration:

Upvotes: -1

Related Questions