如何获取xcassets中LaunchImage图片

时间:2022-10-04 22:06:45
NSDictionary * dic = @{@"320x480" : @"LaunchImage-700", @"320x568" : @"LaunchImage-700-568h", @"375x667" : @"LaunchImage-800-667h", @"414x736" : @"LaunchImage-800-Portrait-736h"};

NSString * key = [NSString stringWithFormat:@"%dx%d", (int)[UIScreen mainScreen].bounds.size.width, (int)[UIScreen mainScreen].bounds.size.height];

UIImage * launchImage = [UIImage imageNamed:dict[key]];