If I need to update a view frame, I can put this code in the -(void)viewWillLayoutSubviewsfollowing way:
- (void)viewWillLayoutSubviews {
self.demoView.frame = CGRectMake(0, 0, 10, 10);
}
or in view mode - (void)layoutSubviews.
However, if I use autolayout now, and I need to update a dynamic object NSLayoutConstraintin the code, I donβt know where to put the code asself.demoWidthConstraint = 10
source
share