Created
September 7, 2012 13:11
-
-
Save advantis/3666158 to your computer and use it in GitHub Desktop.
Easy user interface idiom detection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright © 2012 Yuri Kotov | |
// | |
extern BOOL ADVUserInterfaceIdiomIsPhone; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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