Here is a simple line to get the screen size in xCode.
NSLog(@" %f, %f", winSize.width, winSize.height);
Swift:
UIScreen *screen = [UIScreen mainScreen];
CGRect fullScreenRect = screen.bounds;
//This will be used to get the width and height
fullScreenRect.size.width, fullScreenRect.size.height
And For Games, where Cocoas is using
CGSize winSize = [CCDirector sharedDirector].winSize;
NSLog(@" %f, %f", winSize.width, winSize.height);
Swift:
var screen: UIScreen = UIScreen.mainScreen()
var fullScreenRect: CGRect = screen.bounds
//This will be used to get the width and height
fullScreenRect.size.width, fullScreenRect.size.height
No comments:
Post a Comment