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
Jacques Lalancette
1,483 PointsSwiftris displays poorly in iPhone6. How do I make it stretch?
I completed the free Swiftris tutorial. The game is sized for an iPhone5, but I'm on an iPhone 6, and there are large black blank areas on the right and bottom. How can I stretch/scale the view to use the whole screen?
Please see what I mean: https://www.dropbox.com/s/hyu709bcvifagji/%E5%86%99%E7%9C%9F%202014-10-03%2020%2037%2013.png?dl=0
4 Answers
Ben Holland
Courses Plus Student 4,062 PointsI think that the iPhone 6 and Plus are very new devices and scaling of elements would have to differ since this is a very big change in screen size and since their is now a 4 , 4.7 and 5.5 inch screens not everything would work on all . And you could try adjust the view controller by pressing the view controller then changing the size of the screen. And maybe scaling up the code .
Jacques Lalancette
1,483 PointsThank you for your reply Ben. I've tried changing the size of the view controller, and this and it doesn't fix the problem. Apple said that apps not designed for the iPhone 6 would be scaled (many of mine are).
Ben Holland
Courses Plus Student 4,062 PointsHI Jacques !
Do you have size classes on ? If you do keep them on also with storyboards even though you don't use them you could enable the rectangle since i think that scales apps for all screen sizes .
Jacques Lalancette
1,483 PointsWhen you say size classes, do you mean the Size property under "Simulated Metrics"?
Ben Holland
Courses Plus Student 4,062 PointsYes i think it is.
Jacques Lalancette
1,483 PointsThanks for the suggestion. I've tried fooling with those settings and haven't had any luck.
Ben Holland
Courses Plus Student 4,062 PointsI've done some research and i can see that this is very common for new users in Xcode because it didn't work for me until xcode 6 beta 7 so its very common all my problems were fixed when i upgraded to Yosemite weirdly but that is taking it far . Try re installing it and if you have any other mac computers try it on them
Jacques Lalancette
1,483 PointsI'm using Yosemite 10.10 and Xcode 6.0.1.
Ben Holland
Courses Plus Student 4,062 PointsTry Using App Zapper to completely erase xcode then install it again
Jacques Lalancette
1,483 PointsI tried this, and it still won't display correctly. There must be a setting for this somewhere...
Ben Holland
Courses Plus Student 4,062 PointsIn the Xcode Preferences you can see if all documentation and file paths are correct maybe their is a problem their.
Shahin Zangenehpour
19,146 PointsShahin Zangenehpour
19,146 PointsHi Jacques,
I encountered the same issue and after fiddling with the code found the addition of the following line of code (marked with '+') in the GameScene.swift file to do the trick:
In addition, you may wish to make the play area larger given all the available space on iPhone 6. If so, let me know and I can share my solution with you.