Device detection in iOS
2012-09-28 Updated 2025-12-31 · dc272e6This is just a quick tip on how to determine what device the user is running, this can be useful if you are writing an app for both iPhone and iPad and want to implement a feature in one device but not the other: Code snippet:
if
else if
else
Another thing we can check for is the version of iOS the user is running as well as the system name,here I simply used NSLog to output the results:
NSLog;
NSLog;
UIDevice has many other methods and properties regarding the users device, you can read through them in Apple's documentation here.
Originally posted on Blogspot