Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void) didFinishAutoLayout {
- // Do some stuff here.
- NSLog(@"didFinishAutoLayout");
- }
- - (void) viewDidLayoutSubviews {
- [super viewDidLayoutSubviews];
- [NSObject cancelPreviousPerformRequestsWithTarget:self
- selector:@selector(didFinishAutoLayout)
- object:nil];
- [self performSelector:@selector(didFinishAutoLayout) withObject:nil
- afterDelay:0];
- }
- self.cnsTableviewHeight.constant = 50;
- [self layoutIfNeeded];
- - (void) layoutSubviews { //This method when auto layout engine finishes
- }
- someConstraint.constant = 100; // the change
- // Animate just to make sure the constraint change is fully applied
- [UIView animateWithDuration:0.1f animations:^{
- [self.view setNeedsLayout];
- } completion:^(BOOL finished) {
- // Here do whatever you need to do after constraint change
- }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement