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

Alphonso Sensley II
Alphonso Sensley II
8,514 Points

How to make separate constraints for Landcape and Portrait Orientation

‪Is there an easier way to set different constraints for landscape and portrait orientation? My solution has been to IBOutlet each constraint and then place them in two separate functions to be called when orientation changes. Just thinking there must be an easier way. Lol‬

Hey bro, I think you can accomplish what you're seeking by using size classes. One of the core concepts behind adaptive layout is size classes. A size class is a property applied to any view or view controller that represents the amount of content that can be displayed in a given horizontal or vertical dimension.

1 Answer

Alphonso Sensley II
Alphonso Sensley II
8,514 Points

Myron Hicks thanks man! Appreciate the answer. Another friend told me the same thing. I implemented size classes and it corrected the issue I was having. Thanks again!