Avinash Sharma
Avinash Sharma

Reputation: 111

UIViewController does not respond to rotation function

I have a View Controller embedded in a Navigation Controller,

In my view controller I have defined the function,

-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator

I also do this inside the function,

[super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];

But when I run it on my device the call never reaches here? What I am doing wrong here?

Upvotes: 0

Views: 80

Answers (2)

May Rest in Peace
May Rest in Peace

Reputation: 2207

If the call never reaches the function then check this method supportedInterfaceOrientations .

Probably other interface orientations are masked.

Upvotes: 1

user5917312
user5917312

Reputation:

if you want to rotate the view you can also do this by using this method

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
       return YES;
}

Upvotes: 0

Related Questions