You can use auto - layout for providing both the portrait and landscape mode.
For more details, check this : What is Auto Layout?.
You have to set the constraints for landscape and portrait mode to work. Like if you want a button at the top, you can set constraints on it : from top and left and so on.
If you want a UI element to work change dynamically, you just need to change frame on orientation as per your requirement. Sample code is here :
# pragma mark - Orientation related methods
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration NS_AVAILABLE_IOS(3_0)
{
if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
[self deviceRotatedToLandscapeMode];
}
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight) {
[self deviceRotatedToLandscapeMode];
}
else if (toInterfaceOrientation == UIInterfaceOrientationPortrait) {
[self deviceRotatedToPortraitMode];
}
else if (toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) {
[self deviceRotatedToPortraitMode];
}
}
- (void) deviceRotatedToPortraitMode {
self.mTableView.frame = CGRectMake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height);
}
- (void) deviceRotatedToLandscapeMode {
self.mTableView.frame = CGRectMake(0.0, 0.0, self.view.frame.size.height, self.view.frame.size.height);
}