Skip to content

Instantly share code, notes, and snippets.

@advantis
Created September 7, 2012 13:11
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save advantis/3666158 to your computer and use it in GitHub Desktop.
Easy user interface idiom detection
//
// Copyright © 2012 Yuri Kotov
//
extern BOOL ADVUserInterfaceIdiomIsPhone;
//
// Copyright © 2012 Yuri Kotov
//
BOOL ADVUserInterfaceIdiomIsPhone = NO;
__attribute__((constructor))
static void ADVUserInterfaceIdiomInit()
{
@autoreleasepool
{
ADVUserInterfaceIdiomIsPhone = (UIUserInterfaceIdiomPhone == [[UIDevice currentDevice] userInterfaceIdiom]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment