1

I'm having an issue with the safe area on iOS 10 where I trigger a segue to a view controller with hidesBottomBarOnPush enabled. The content which is pinned to the bottom safe area on this view controller starts off above the tabs then jumps to the bottom once the view has fully loaded.

How do I avoid this behaviour on iOS 10? Pinning to superview is not an option as iPhone X support is required.

enter image description here

Constraints on the label:

enter image description here

TomRichardson
  • 5,933
  • 5
  • 27
  • 30

1 Answers1

0

Pinning to superview, bind to the attribute, like this


@interface YourViewController ()

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomConstraint;

@end

@implementation YourViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    CGFloat bottomValue = 0.0f; // your value
    UIEdgeInsets edgeInsets = UIApplication.sharedApplication.keyWindow.layoutMargins;
    CGFloat bottomInset = edgeInsets.bottom;
    self.bottomConstraint.constant = - bottomInset - bottomValue;
}

@end

Nullable
  • 761
  • 5
  • 17