Last active
December 18, 2015 15:19
-
-
Save xandrucea/5803889 to your computer and use it in GitHub Desktop.
Device identification
This file contains hidden or 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
check if device is jailbraiked | |
(Not all users have installed Cydia, maybe check any root dir outside the sandbox -->/bin/usr) | |
------------------------------ | |
NSString *filePath = @"/Applications/Cydia.app"; | |
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) | |
{ | |
// do something useful | |
} | |
CGSize *screenSize = [[UIScreen mainScreen] bounds].size; | |
if(screenSize.height > 480.0f){ | |
[self setShadowForButton:aButton]; | |
NSLog(@"Im an iPhone 5"); | |
} | |
init classes and call implicit xib files | |
----------------------------------------- | |
- (id)init{ | |
NSString *nibName; | |
if(self){ | |
if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){ | |
nibName = @"EntryViewController"; | |
}else{ | |
nibName = @"EntryViewController~iPad"; | |
} | |
} | |
return [self initWithNibName:nibName bundle:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment