Skip to content

Instantly share code, notes, and snippets.

@Sahasrara
Created October 3, 2013 21:04
Show Gist options
  • Save Sahasrara/6817105 to your computer and use it in GitHub Desktop.
Save Sahasrara/6817105 to your computer and use it in GitHub Desktop.
- (void) viewWillAppear:(BOOL)animated {
// Update Layout so Constraints are satified
[self.view layoutIfNeeded];
self.deviceListViewController.view.frame = self.leftBarContainerView.bounds;
[self.leftBarContainerView addConstraint:[NSLayoutConstraint constraintWithItem:self.leftBarContainerView attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:self.deviceListViewController.view
attribute:NSLayoutAttributeTop
multiplier:1.0f constant:0]];
[self.leftBarContainerView addConstraint:[NSLayoutConstraint constraintWithItem:self.leftBarContainerView attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:self.deviceListViewController.view
attribute:NSLayoutAttributeBottom
multiplier:1.0f constant:0]];
[self.leftBarContainerView addConstraint:[NSLayoutConstraint constraintWithItem:self.leftBarContainerView attribute:NSLayoutAttributeLeading
relatedBy:NSLayoutRelationEqual
toItem:self.deviceListViewController.view
attribute:NSLayoutAttributeLeading
multiplier:1.0f constant:0]];
[self.leftBarContainerView addConstraint:[NSLayoutConstraint constraintWithItem:self.leftBarContainerView attribute:NSLayoutAttributeTrailing
relatedBy:NSLayoutRelationEqual
toItem:self.deviceListViewController.view
attribute:NSLayoutAttributeTrailing
multiplier:1.0f constant:0]];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment