I have an app that runs on the iPhone and iPod Touch, it can run on the Retina iPad and everything but there needs to be one adjustment. I need to detect if the current device is an iPad. What code can I use to detect if the user is using an iPad in my UIViewController
and then change something accordingly?
IOS detect if user is on an iPad
deviceiosipadobjective cswift
Related Topic
- Ios – Passing data between view controllers
- Javascript – Detect if device is iOS
- Ios – How to detect iPhone 5 (widescreen devices)
- Javascript – Detect iPad Mini in HTML5
- IOS app with framework crashed on device, dyld: Library not loaded, Xcode 6 Beta
- C# – Permissions problem when starting .NET app from .NET service as a different user
- Asp – HttpHandlers with ASP.NET MVC
- R – CMake: how do you copy private frameworks into the application bundle under OS X
Best Answer
There are quite a few ways to check if a device is an iPad. This is my favorite way to check whether the device is in fact an iPad:
The way I use it
Other Examples
For a Swift solution, see this answer: https://stackoverflow.com/a/27517536/2057171