Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS

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.

4 Answers

Chris Shaw
Chris Shaw
26,650 Points

Hi 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.

Hi, 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.

Sebastien Thomas
Sebastien Thomas
16,502 Points

Hi 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.

I 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
Sebastien Thomas
16,502 Points

Have you tested your app on an actual device ?

I've tested it on an iPad mini

Brenden Konnagan
Brenden Konnagan
16,858 Points

Hello 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!