Skip to content

Instantly share code, notes, and snippets.

@0xc010d
Forked from advantis/ADVUserInterfaceIdiom.h
Created September 10, 2012 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xc010d/3689825 to your computer and use it in GitHub Desktop.
Save 0xc010d/3689825 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