How to check if your app is running on an iPad or an iPhone

- by

Here’s how we check that:

    // if we're an iPad
    if ([[UIDevice currentDevice]userInterfaceIdiom] == UIUserInterfaceIdiomPad) {

        // do some iPad or iPad Mini specific stuff
    } else {

        // we're on iPhone or iPod Touch

Alternatively you can check the same method for UIUserInterfaceIdiomPhone instead, which is returned when you’re on an iPhone or iPod touch.

Add your voice!

This site uses Akismet to reduce spam. Learn how your comment data is processed.