I have a ViewController (searchListViewController) in my storyboard. This ViewController is embedded in a navigationController. The ViewController in storyboard rotates properly when orientation changes.
I have an XIB which contains an UIView (CustomAlertView). I want to present this CustomAlertView from my searchListViewController.
To do this, i have included the following code in my searchListViewController class.
searchListViewController.m:
-(void)loadCustomAlertView
{
NSArray *allviews = [[NSBundle mainBundle] loadNibNamed:@"CustomAlertView" owner:self options:nil];
CustomAlertView *customAlertView_Obj = allviews[0];
[self.navigationController.view addSubview:customAlertView_Obj];
}
The Problem is: the parent navigation controller rotates properly, but the child "CustomAlertView" does not rotate when the orientation changes. Am i doing anything wrong in this code?
Is there anyway to handle rotations for an XIB file programmatically?
I want to use the same CustomAlertView XIB for both Portrait and Landscape. Is it possible?