-
-
Save ast3150/7f9bf9af23a56c16bdfce9ec60b3010e to your computer and use it in GitHub Desktop.
iOS get App Launch Image
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
+ (UIImage*)getLaunchImage | |
{ | |
UIImage* launchImage = nil; | |
NSArray* imagesDict = [[MainBundle infoDictionary] valueForKey:@"UILaunchImages"]; | |
for (NSDictionary* dict in imagesDict) { | |
CGSize launchImageSize = CGSizeFromString(dict[@"UILaunchImageSize"]); | |
if (CGSizeEqualToSize([UIScreen mainScreen].bounds.size, launchImageSize)) { | |
launchImage = [UIImage imageNamed:dict[@"UILaunchImageName"]]; | |
break; | |
} | |
} | |
return launchImage; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added a break after a launchImage is found. It will probably make not much of a difference but is better practice.