Skip to content

Instantly share code, notes, and snippets.

@jeksys
Created May 3, 2011 14:12
Show Gist options
  • Save jeksys/953398 to your computer and use it in GitHub Desktop.
Save jeksys/953398 to your computer and use it in GitHub Desktop.
iPad?
+ (BOOL)isRunningOniPad
{
static BOOL hasCheckediPadStatus = NO;
static BOOL isRunningOniPad = NO;
if (!hasCheckediPadStatus)
{
if ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)])
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)
{
isRunningOniPad = YES;
hasCheckediPadStatus = YES;
return isRunningOniPad;
}
}
hasCheckediPadStatus = YES;
}
return isRunningOniPad;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment