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
Robin Kirsch
30 Pointswidth and height iOS Simulator always 768 x 1024 all devices?!
Hello,
my problem is, that i've wrote a program just with a platform moving from left side to right side via SKActions.I want it to work in Portrait and in Landscape. Thats why I've replaced the viewDidLoad Function with the viewWillLayoutSubviews function in my viewcontroller.m. The Problem is, it doesnt matter which iOS Simulator Device I take, the "real screen size" is always 768 x 1024. That makes no sense to me. When I draw my platform for example at point x=10, y = 10 via redbox.position = CGPointMake(20,20);, then you cant see it. If i take iPhone 6 as Simulator, its 768 x 1024 , if i take iPad air its the same and so on. Im using NSLog(@"width:%f, height:%f", self.size.height, self.size.width); to see the width and height.
I am using the function didMoveToView in my GameScene.m.
I've tried the scale one or cmd 1 cmd 2 combinations to scale it, but that didnt help!
Can you help me?
Kind Regards,
Robink
2 Answers
Caleb Kleveter
Treehouse Moderator 37,862 PointsFirst, welcome to Treehouse, I am sure you will enjoy the wonderful community; on to the question. Is it possible that the console log is saying the normal size of the app is 768 x 1024? Does the size of the simulator change?
Caleb Kleveter
Treehouse Moderator 37,862 PointsI'm glad it works now! Happy coding!
Robin Kirsch
30 PointsRobin Kirsch
30 PointsThanks for your answer. I just changed from the methods viewdidload and didMoveToView to the methods viewWillLayoutSubviews and initWithSize. It works much better!