Skip to content

Instantly share code, notes, and snippets.

@0xc010d
Forked from advantis/ADVUserInterfaceIdiom.h
Created September 10, 2012 09:13
Show Gist options
  • 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