mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-23 20:47:44 +00:00
Utilize Bundle
This commit is contained in:
parent
8d8a2b2135
commit
e389ecb6d6
1 changed files with 12 additions and 4 deletions
|
|
@ -114,11 +114,19 @@
|
|||
}
|
||||
|
||||
NSString *iconName = self.appIcons[self.selectedIconIndex];
|
||||
|
||||
UIImage *iconImage = [UIImage imageNamed:iconName];
|
||||
|
||||
NSString *path = [[NSBundle mainBundle] pathForResource:@"uYouPlus" ofType:@"bundle"];
|
||||
NSBundle *bundle = [NSBundle bundleWithPath:path];
|
||||
NSString *imagePath = [bundle pathForResource:iconName ofType:@"png"];
|
||||
UIImage *iconImage = [UIImage imageWithContentsOfFile:imagePath];
|
||||
|
||||
if (!iconImage) {
|
||||
NSLog(@"Failed to load custom icon image");
|
||||
return;
|
||||
}
|
||||
|
||||
UIImage *roundedIconImage = [self createRoundedImage:iconImage size:CGSizeMake(120, 120)]; // Adjust size as needed
|
||||
|
||||
// Save the image to the main app bundle
|
||||
|
||||
NSData *imageData = UIImagePNGRepresentation(roundedIconImage);
|
||||
NSString *newIconPath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@_custom", iconName] ofType:@"png"];
|
||||
[imageData writeToFile:newIconPath atomically:YES];
|
||||
|
|
|
|||
Loading…
Reference in a new issue