Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. - (void) didFinishAutoLayout {
  2.  
  3. // Do some stuff here.
  4.  
  5. NSLog(@"didFinishAutoLayout");
  6. }
  7.  
  8. - (void) viewDidLayoutSubviews {
  9. [super viewDidLayoutSubviews];
  10.  
  11.  
  12. [NSObject cancelPreviousPerformRequestsWithTarget:self
  13. selector:@selector(didFinishAutoLayout)
  14. object:nil];
  15. [self performSelector:@selector(didFinishAutoLayout) withObject:nil
  16. afterDelay:0];
  17. }
  18.  
  19. self.cnsTableviewHeight.constant = 50;
  20. [self layoutIfNeeded];
  21.  
  22. - (void) layoutSubviews { //This method when auto layout engine finishes
  23. }
  24.  
  25. someConstraint.constant = 100; // the change
  26.  
  27. // Animate just to make sure the constraint change is fully applied
  28. [UIView animateWithDuration:0.1f animations:^{
  29. [self.view setNeedsLayout];
  30. } completion:^(BOOL finished) {
  31. // Here do whatever you need to do after constraint change
  32. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement