I have an UIViewController
that contains the main UIView
and inside of this are a small UIView
on the top and a UITableView
that fills the rest of the space.
All the design has been done with Storyboards and autolayout, so basically there are these constraints for the upper UIView
:
- Top space = 0px to superview
- Leading space = 0px to superview
- Trailing space = 0 px superview
- Height = 44px
And these for the UITableView
:
- Top space = 0px to
UIView
- Bottom space = 0px to superview
- Leading space = 0px to superview
- Trailing space = 0 px superview
Everything works fine and resizes properly when using a different screen size or orientation. What I am trying to do now is deleting the top UIView
programmatically and then I want the UITableView
to fill the space to the top of the superview.
I know I could create programmatically a new constraint for the UITableView
, but what I am looking for is for a low-priority-constraint? already defined in the Storyboard that can coexist with the ones already defined before.
Any other trick or workaround would be also appreciated, the only restriction is that everything should be designed in the Storyboard and everything should work after calling:
[view removeFromSuperview];
Here is the design: