I am making an app which would be in both modes portrait as well as landscape. For iOS 5.0
I am adding views by following way i.e.
-(BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
if(((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeRight)))
{
productname.frame=CGRectMake(240, 97, 106, 20);
self.view = landscapeView;
}
else if
(((interfaceOrientation == UIInterfaceOrientationPortrait) ||
(interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown))){
productname.frame=CGRectMake(153, 151, 106, 20);
self.view = portraitView;
}
return YES;
}
But for iOS 6.0
I got following two methods for orientation,
- (NSUInteger)supportedInterfaceOrientations
- (BOOL)shouldAutorotate
I actually need a method which must fire during rotation of device. If anyone has an idea please let me know. I already wasted alot of time on it.
Thanks a lot in advance.