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!
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
How 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.
Chris Shaw26,676 Points
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 Thomas16,502 Points
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.
Brenden Konnagan16,858 Points
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!