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

iOS

Harris Ryder
Harris Ryder
1,333 Points

what are anchors?

what are anchors, they are used in the video to constrain an image view to the viewcontrollers view right?

I have completed the auto layout course and I have never come across them before what are they, what do they represent visually?

and what visually is he constraining the image view to?

Thanks!

1 Answer

Kenan Bateman
Kenan Bateman
16,715 Points

Hi Harris,

Anchors position elements in relation to one another. So if you anchored something 20px from the top edge, it would always sit 20px from that point. You can think of them visually like spaces in most cases.