|
[Objective-C] UIImage from icon app |
|
 |
+ (UIImage*)imageFromIconApp {
NSString *iconName = nil;
NSDictionary *info = [[NSBundle mainBundle] infoDictionary];
NSArray *iconfiles = [info valueForKeyPath:@"CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles"];
if (iconfiles == nil || [iconfiles count] == 0) iconfiles = [info objectForKey:@"CFBundleIconFiles"];
if (iconfiles != nil && [iconfiles count] > 0) {
iconName = [iconfiles objectAtIndex:0];
} else {
iconName = [info objectForKey:@"CFBundleIconFile"];
}
return [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[iconName stringByReplacingOccurrencesOfString:@"@2x" withString:@""] ofType:@"png"]];
}
|
|
|
|
|
|
|
|
Copyright © 1996-2021 Centro Studi Informatica di Danilo Priore. All rights reserved. P.I.10149810581. |
|
|
|