mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-17 20:32:10 +00:00
Create AppIconManager.m
This commit is contained in:
parent
9501445c19
commit
57b1ac17a9
1 changed files with 18 additions and 0 deletions
18
Sources/AppIconManager.m
Normal file
18
Sources/AppIconManager.m
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#import "AppIconManager.h"
|
||||
|
||||
@implementation AppIconManager
|
||||
|
||||
+ (void)setIcon:(NSString *)appIcon completion:(void (^)(BOOL))completion {
|
||||
[[UIApplication sharedApplication] setAlternateIconName:appIcon completionHandler:^(NSError * _Nullable error) {
|
||||
if (error) {
|
||||
NSLog(@"Error setting alternate icon %@: %@", appIcon, error.localizedDescription);
|
||||
}
|
||||
completion(error != nil);
|
||||
}];
|
||||
}
|
||||
|
||||
+ (void)doesNotSupport {
|
||||
[[UIApplication sharedApplication] setAlternateIconName:nil completionHandler:nil];
|
||||
}
|
||||
|
||||
@end
|
||||
Loading…
Reference in a new issue