Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Welby Obeng
20,340 PointsSwift 2.0 : Confused between update frames vs constraints
Pasan Premaratne and others
I'm a little confused between update frames vs constraints. I usually try one or the other until I get what I want. Instead of that approach I want to understand what both are and how to pick it.
Thanks in advance
1 Answer
Florin Veja
6,912 PointsWelby,
Here's now I understand it.
If you update Frames, your object on the screen gets modified. Meaning, if you have a label, the computer looks at the constraints you set up, and it moves and or changes the size of the label in accordance to what constraints are set up.
If you update constraints, the computer looks at the location and size of the your object, and changes the constraints.
See also: developer.apple.com
Let me know if this helps!
Cheers,
Florin