Skip to content

Instantly share code, notes, and snippets.

@edwardean
Created December 17, 2015 08:54
Show Gist options
  • Save edwardean/f28266aaa648f6667e02 to your computer and use it in GitHub Desktop.
Save edwardean/f28266aaa648f6667e02 to your computer and use it in GitHub Desktop.
NSString *imageName = nil;
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
NSString *orientation = @"Portrait";//Landscape
NSDictionary *bundleInfoDict = [[NSBundle mainBundle] infoDictionary];
NSArray *imagesDict = [bundleInfoDict valueForKey:@"UILaunchImages"];
for (NSDictionary *dic in imagesDict) {
CGSize imageSize = CGSizeFromString(dic[@"UILaunchImageSize"]);
if (CGSizeEqualToSize(imageSize, screenSize) &&
[orientation isEqualToString:dic[@"UILaunchImageOrientation"]]) {
imageName = dic[@"UILaunchImageName"];
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment