I know the iPhone has 480 x 320 and iPad is 1024 x 768 but I don’t know how to determine that programmatically. I’d appreciate any help I can get.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This automatically means that the touch is on the screen, so any touch-point returned would be valid, but still the code below might help your understanding:
Receive Screen size with:
[UIScreen mainScreen].bounds.sizeHeight of iOSDevice in pixels returned with:
Width of iOSDevice in pixels returned with:
Is the iOSDevice an iPhone with:
Is the iOSDevice an iPad with:
Another stackOverflow question here shows you could also use
Return the entire screen resolution in points (320×400, etc.) with:
Return the screen resolution scale with:
Another way to get the pixel width and height with the two above lines included: