I am using
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
delegate to change the frame of my view based on the orientation type
i.e.,
if(UIInterfaceOrientationIsLandscape(interfaceOrientation))
{
self.view.frame=CGRectMake(0,0,500,300);
}
else
{
self.view.frame=CGRectMake(0,0,300,400);
}
How to handle the same situation in iOS 6 as
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
has been deprecated in iOS6.
I am using the following delegate to set all the orientations.
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationAllMask;
}
But,
-(BOOL)shouldAutoRotate
{
return YES;
}
is not getting invoked. How to handle this situation?
Use
willAnimateRotationToInterfaceOrientation
in iOS6.