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 trialJunaid Abdurahman
Courses Plus Student 87 PointsHow do I restrict my app for only iPhone 6 and 6 Plus?
I am about to release my app but I want to restrict it to iPhone 6 and 6 Plus or for xcode to scale down the down the app for the iPhone 5 and 5S since they have the same 16:9 aspect ratio.
4 Answers
Chris Shaw
26,676 PointsHi Junaid,
There is no way to do this as your app should work for all resolutions and then scale up for the iPhone 6/6+, Apple introduced a new feature in Xcode 6 which is size classes.
What size classes allow you to do is build an app for any iPhone resolution for example without needing to resize your storyboard for the iPhone 6/6+, to use class sizes you simply need to open your storyboard and select the master view (the initial view), next in the file inspector on the right hand side check the box that has size classes next to it, also make sure you have auto layout checked as well.
Now that you have that done you should have seen your views get larger width wise and smaller in height, what you can do from here on out is build your app using size classes and it will appear the same way on all resolutions, for the iPhone 6/6+ you can programatically add/show new views because of the extended real-estate.
Hope that helps.
Sebastien Thomas
16,502 PointsHi Junaid,
Not sure Apple would let you do that.
You could release your app for the very latest version of iOS and that would restrict iPhone 4 users for instance but right now, that's about it.
Junaid Abdurahman
Courses Plus Student 87 PointsI made my app using the iPhone 6 template in xcode, is there anyway to make it scale the UI up or down so it will work properly with the iPhone 5,5S and 6 Plus since they all have the same aspect ratio
Sebastien Thomas
16,502 PointsHave you tested your app on an actual device ?
Junaid Abdurahman
Courses Plus Student 87 PointsI've tested it on an iPad mini
Brenden Konnagan
16,858 PointsHello Junaid!
Apple has UI tools built into Interface builder that will assist with this. Check out size classes and auto layout. I know that there are some classes regarding them right here at Treehouse, and Apple has some great documentation.
Hope the best!
Junaid Abdurahman
Courses Plus Student 87 PointsJunaid Abdurahman
Courses Plus Student 87 PointsHi, i tried this and it ran fine in the iPhone 6 simulator as before when I run it in the iPhone 5 simulator the UI is cut off at the bottom and right, also when i run it in the 6 Plus simulator i get white boarders.