xcode7 获取 LaunchImage
2016-05-18 本文已影响50人
Yang152412
@implementation UIImage (GetLaunchImage)
+ (UIImage *)getTheLaunchImage {
NSDictionary * dict = @{@"320x480" : @"700", @"320x568" : @"700-568h", @"375x667" : @"800-667h", @"414x736" : @"800-Portrait-736h"};
NSString * key = [NSString stringWithFormat:@"%dx%d", (int)[UIScreen mainScreen].bounds.size.width, (int)[UIScreen mainScreen].bounds.size.height];
// Brand Assets 和 Assets.xcassets 中作为 LaunchImage的 assets 名字保持一致
NSString *imageName = [NSString stringWithFormat:@"Brand Assets-%@",dict[key]]; return [UIImage imageNamed:imageName];}
@end