Quick tip: More Constraint Animation Advice (Route 85)
Why Stack Overflow recommends it
Stack Overflow users link it when asking or answering how to animate UIView constraints, such as expanding and collapsing views or reactivating constraints, in iOS.
Recommended by 1 people across 1 different months, 2016 to 2017.
What it is
A short Google Developers 'Route 85' tip video on animating Auto Layout constraints in iOS apps. It follows an earlier video and covers making constraint animations more efficient and handling them in more complex view hierarchies.
What people said
Strong rec Joseph · 2016-03 · Stack Overflow · on “Are UIView constraints implicitly reactivated?”
This great tip completely answered my question: Quick tip: More Constraint Animation Advice (Route 85) [this video]
Cites alvarlagerlof · 2016-09 · Stack Overflow · on “Collapse and expand a view in a tableView”
I want to expand and collapse a view in a tableView. Watched this video: [this video] ishidden = true didn't work because the height is still there func expandCollapse(sender:UIButton) { let collapseImage = UIImage(named: "collapse") let expandImage = UIImage(named: "expand") let row = sender.tag let indexPath = NSIndexPath(forRow: row, inSection: 0) let cell = self.table.cellForRowAtIndexPath(indexPath) as! ArchiveViewCell if (sender.currentImage == UIImage(named: "expand")) { sender.setImage(collapseImage, forState: UIControlState.Normal) cell.moreViewHeight.priority = 1 cell.moreViewHeight.constant = 0 cell.moreView.layoutIfNeeded() } else { sender.setImage(expandImage, forState: UIControlStat
Cites jlmurph · 2017-07 · Stack Overflow · on “iOS - UIScrollView inside UICollectionViewCell - animation is not correct (delayed) for inner view”
You need to provide more code. But two things first to start with which you should take into account: Animations and .layoutIfNeeded() are intensive methods to call, anywhere in an app. They usually completetely re-calculates constraints, sizing, positionning etc. You also need to bear in mind, the more subviews present in the view you are calling it on, the heavier the task. In your case, you are calling it on the lowest views in the hierarchy, then moving up to their superViews to call it again, and then you call it a third time on the highest view of the hierarchy.. So You're doing the work three times for each sub-subview (in this case DetailedView ), twice for your middle subviews (your