UIView bounds and transformsBasics article available: Layout Anchors
A really interesting side-effect of a
bounds being its rect within its own coordinate system is that transforms don't affect it at all. That's why it's usually a better fit than
frame when doing layout calculations of subviews.
let view = UIView() view.frame.size = CGSize(width: 100, height: 100) view.transform = CGAffineTransform(scaleX: 2, y: 2) print(view.frame) // (-50.0, -50.0, 200.0, 200.0) print(view.bounds) // (0.0, 0.0, 100.0, 100.0)
My favorite continuous integration service. Automatically build, test and distribute your app on every single commit that you make. Bitrise is fast, rock solid, and takes just a few minutes to set up. Try it for free, and see how it can improve your team’s workflow.