mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +00:00
Update AppIconOptionsController.m
This commit is contained in:
parent
3c94b4ba98
commit
5fc2d7c204
1 changed files with 4 additions and 4 deletions
|
|
@ -76,7 +76,7 @@
|
|||
cell.textLabel.text = iconName;
|
||||
|
||||
UIImage *iconImage = [UIImage imageNamed:iconName];
|
||||
cell.imageView.image = [self resizeImage:iconImage newSize:CGSizeMake(40, 40)];
|
||||
cell.imageView.image = [self createRoundedImage:iconImage size:CGSizeMake(40, 40)];
|
||||
|
||||
if (indexPath.row == self.selectedIconIndex) {
|
||||
cell.accessoryType = UITableViewCellAccessoryCheckmark;
|
||||
|
|
@ -119,12 +119,12 @@
|
|||
UIImage *iconImage = [UIImage imageNamed:iconName];
|
||||
UIImage *roundedIconImage = [self createRoundedImage:iconImage size:CGSizeMake(120, 120)]; // Adjust size as needed
|
||||
|
||||
// Copy the image to the main app bundle
|
||||
// Save the image to the main app bundle
|
||||
NSData *imageData = UIImagePNGRepresentation(roundedIconImage);
|
||||
NSString *newIconPath = [[NSBundle mainBundle] pathForResource:iconName ofType:@"png"];
|
||||
NSString *newIconPath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@_custom", iconName] ofType:@"png"];
|
||||
[imageData writeToFile:newIconPath atomically:YES];
|
||||
|
||||
[[UIApplication sharedApplication] setAlternateIconName:iconName completionHandler:^(NSError * _Nullable error) {
|
||||
[[UIApplication sharedApplication] setAlternateIconName:[NSString stringWithFormat:@"%@_custom", iconName] completionHandler:^(NSError * _Nullable error) {
|
||||
if (error) {
|
||||
NSLog(@"Error setting alternate icon: %@", error.localizedDescription);
|
||||
[self showAlertWithTitle:@"Error" message:@"Failed to set alternate icon"];
|
||||
|
|
|
|||
Loading…
Reference in a new issue