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 Introduction to Auto Layout in iOS Visual Format Language Complex Format Strings

The TopLayoutGuide is now deprecated in iOS 11.0, therefore what should we use and how would we apply it?

When you type in the following line of code self.topLayoutGuide , apple inform us that the topLayoutGuide was deprecated in iOS 11.0, what would be the correct thing to put instead of this?

2 Answers

Sarah Hurtgen
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sarah Hurtgen
Treehouse Project Reviewer

I haven't used it myself, so I don't know the exact line of code you would replace it with - but I believe it has been replaced with safeAreaLayoutGuide, if you want to look into that approach. Here's a link to the Apple Documentation. Hope that helps!

Gustav Kjellin
Gustav Kjellin
6,664 Points

As far as I can tell, there's no way to access the safe area layout guide through the visual format language. Check this link for a discussion on it.