Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Build an Interactive Story App with Swift Creating the User Interface Programmatically Creating Views Programmatically

Harris Ryder
Harris Ryder
1,333 Points

anchors, what are they?

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?


1 Answer

Hi Harris,

Anchors represent a particular attribute of a view and allow the adjustment of constraints in code.

Anchors are actually covered in the Beginner iOS Track under Introduction to Auto Layout in iOS. See Auto Layout in Code < Layout Anchors.

I hope this clears things up,