iOS equivalent for Android View.GONE visibility mode
Adding a constraint(NSLayoutAttributeHeight) that sets height of the view to 0 worked for me:
[self.view addConstraint:[NSLayoutConstraint constraintWithItem:self.captchaView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0]];
All of answers on this questions are inefficient.Best way to equvailent of Android setVisibility:Gone method on iOS is that StackView
first select components then in editor, embed in, Stack View,
connect new stack view with IBOutlet, then:
hidden:
UIView * firstView = self.svViewFontConfigure.arrangedSubviews[0]; firstView.hidden = YES;
visibility:
UIView * firstView = self.svViewFontConfigure.arrangedSubviews[0]; firstView.hidden = NO;
as using stack view, all constraints will be keeped!