iOS Animations with Auto Layout
summary
Explains how to animate Auto Layout by actually changing constraints and letting UIKit animate position/size: make an NSLayoutConstraint IBOutlet, change its constant or deactivate old constraint and add new one with a different multiplier, then call layoutIfNeeded() inside an animation block (can use spring). Shows failure case where moving view.center is undone by a relayout when keyboard appears, demos resizing a top bar, and using UIStackView’s arrangedSubviews.hidden toggle to animate layout — all examples work.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:04Why animations matter
- 6:20Auto Layout animation pitfalls
- 12:02How Auto Layout works
- 18:31Auto Layout animation techniques
- 21:04Animating constraints with outlets
- 28:12Changing multipliers dynamically
- 37:16Auto Layout animation takeaways
- 37:59Introducing stack views
- 44:03Adaptive layouts with stack views
- 47:37Animating stack views
- 50:12Summary








