xcode7 獲取 LaunchImage

weixin_33716557發表於2016-05-18
@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

相關文章