Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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