iOS中如何获取image.xcassets中的启动图片

时间:2023-03-08 16:18:07
iOS中如何获取image.xcassets中的启动图片

/**

*  获取启动图片

*/

+(UIImage *)launchImage{

NSString *imageName=@"LaunchImage-700";

if(iphone5x_4_0) imageName=@"LaunchImage-700-568h";

if(iphone6_4_7) imageName = @"LaunchImage-800-667h";

if(iphone6Plus_5_5) imageName = @"LaunchImage-800-Portrait-736h";

UIImage *image = [UIImage imageNamed:imageName];

NSAssert(image != nil, @"Charlin Feng提示您:请添加启动图片!");

return image;

}