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

inequality constraints in code Swift

So I have coded my whole vc and created all the constraints (I have completely ditched storyboards for this project). I was wondering how do you have a inequality constraint in code? Meaning that if the app is run on a iPhone 7 plus then the image view is 120 from the top, BUT if the app is run on an iPhone se then it is only 60 from the top? This is my first time ditching storyboards so I am not familiar with everything. Thanks in advance!

1 Answer

Create a size class and then you can just do based on a certain uidevice screen size you display a certain image and position.