获取Images.xcassets启动图、Images.xcassets Icon

获取Images.xcassets Icon文件

NSDictionary *infoPlist = [[NSBundle mainBundle] infoDictionary];
NSString *icon = [[infoPlist valueForKeyPath:@"CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles"]lastObject];
UIImage *image = [UIImage imageNamed:icon];

获取Images.xcassets启动图

+ (NSString *)fetchLunchImageName
{
CGSize winSize = [UIScreen mainScreen].bounds.size;
NSArray* imagesDict = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"UILaunchImages"];
for (NSDictionary* dict in imagesDict) {
if(CGSizeEqualToSize(CGSizeFromString(dict[@"UILaunchImageSize"]),winSize))
{
return dict[@"UILaunchImageName"];
}
}
return nil;
}

App version

NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];

Bundleid

NSString *bundleid = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];