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 Build an Interactive Story App with Swift 2 Creating the User Interface Programmatically Displaying the Story

Anna Vorozova
PLUS
Anna Vorozova
Courses Plus Student 523 Points

What difference is between leftAnchor and leadingAnchor or rightAnchor and trailingAnchor?

What difference is between leftAnchor and leadingAnchor or rightAnchor and trailingAnchor?

1 Answer

Anjali Pasupathy
Anjali Pasupathy
28,883 Points

To my understanding of the terms:

Left and right anchors refer to the left and right sides of the view.

Leading and trailing anchors, however, refer to the direction in which words and sentences are written. In English, which is written left-to-right, the leading anchor refers to the left, and the trailing anchor refers to the right. In languages that are written right-to-left, such as Arabic or Hebrew, the leading anchor refers to the right, and the trailing anchor refers to the left.

I hope this helps!