For some reason, if I subclass ECSlidingViewContoller, it won't rotate (and neither will any subview).
Basically if I do this, popUpViewController.view
won't rotate:
@interface DSlidingViewController : ECSlidingViewController
DPopUpViewController *popUpViewController = [self.storyboard instantiateViewControllerWithIdentifier:identifier];
[self addChildViewController:popUpViewController];
[self.view addSubview:popUpViewController.view];
[popUpViewController.view setTranslatesAutoresizingMaskIntoConstraints:NO];
NSDictionary *viewDictionary = @{@"view": popUpViewController.view};
NSArray *verticalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[view]|"
options:0
metrics:nil
views:viewDictionary];
NSArray *horizontalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[view]|"
options:0
metrics:nil
views:viewDictionary];
[self.view addConstraints:verticalConstraints];
[self.view addConstraints:horizontalConstraints];
But if I change the interface to this, everything works as expected. popUpViewController.view
will rotate and occupy the whole screen. (But obviously this is no good since I need ECSliding).
@interface DSlidingViewController : UIViewController
So I have two questions:
- Is it possible to make this work? If so, what am I doing wrong?
- If it's not possible, then where should I add
popUpViewController.view
to to make it behave like aUIAlertView
? (It must be shown above ECSliding's leftMenu and topView).