I would like to know if there is a way to find out the size of the screen that the user is using or the model of your iPhone via Objectice-C.
I would like to know if there is a way to find out the size of the screen that the user is using or the model of your iPhone via Objectice-C.
To find the screen size in points , you can use the bounds
method:
CGRect screenBounds = [[UIScreen mainScreen] bounds];
If you want to know the screen size in pixels , you need to figure out the scale of the screen. For example, older phones will have a 1.0 scale, retina 2.0, and larger ones (e.g. iPhone 6 Plus) 3.0.
CGFloat screenScale = [[UIScreen mainScreen] scale];
And then convert from points to pixels :
CGSize screenSize = CGSizeMake(screenBounds.size.width * screenScale, screenBounds.size.height * screenScale);