views:

60

answers:

2

Hi everyone,

I would like to get the iphone screen size to give calculation, but I did not found any documentation how to get it. Would you please figure it out for me?

Thanks

+2  A: 

You can use the bounds property on an instance of UIScreen:

CGRect screenSize = [[UIScreen mainScreen] bounds];

Most people will want the main screen; if you have a device attached to a TV, you may instead want to iterate over UIScreens and get the bounds for each.

More info at the UIScreen class docs.

Tim
That's work, thank for your response.
haisergeant
+1  A: 

Use the property bounds of UIView if you want to know the size of a certain view or [[UIScreen mainScreen] bounds] if you want to know the screen size of the device.

tob
Thank you for your response
haisergeant