So there is a button I'd like to throw out of the view hiearchy. If I do:
-(void)viewDidLoad
{
[super viewDidLoad];
[self.button removeFromSuperView];
}
When I run the app, I see the button.
Now if I do:
-(void)viewDidLoad
{
[super viewDidLoad];
self.button.hidden = YES;
}
It's hidden.
What's the proper way to deal with this? I'd image that the layout engine would automatically throw out the constraints of a view when it's removed from the view hierarchy.
Not sure what constraint would 'force' a subview to remain in it's superview. Align center in container maybe? I don't really want to make outlets to like 20 different constraints.
Well I figured it out. it's a bug in Interface Builder it seems.
If you add a subview for a particular size class....(say Width Regular and Height Regular)...that's all you need to do.
Switch back to Any x Any... try to remove a subview it from the superview...and it won't happen. Adding a subview for a specific size class throws it off. It'll still hide though.
I would add some screenshots..but it doesn't look like the new forums support attaching images?