mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +00:00
Add “App Icon” Button - RootOptionsController.m
This commit is contained in:
parent
11ad0ea7f7
commit
f7b8af3efe
1 changed files with 17 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#import "RootOptionsController.h"
|
||||
#import "ColourOptionsController.h"
|
||||
#import "ColourOptionsController2.h"
|
||||
#import "AppIconOptionsController.h"
|
||||
|
||||
@interface RootOptionsController ()
|
||||
@end
|
||||
|
|
@ -14,6 +15,9 @@
|
|||
|
||||
UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done)];
|
||||
self.navigationItem.leftBarButtonItem = doneButton;
|
||||
|
||||
UIBarButtonItem *appIconButton = [[UIBarButtonItem alloc] initWithTitle:@"App Icon" style:UIBarButtonItemStylePlain target:self action:@selector(showAppIconOptions)];
|
||||
self.navigationItem.rightBarButtonItem = appIconButton;
|
||||
|
||||
UITableViewStyle style;
|
||||
if (@available(iOS 13, *)) {
|
||||
|
|
@ -164,6 +168,19 @@
|
|||
|
||||
@implementation RootOptionsController (Privates)
|
||||
|
||||
- (void)showAppIconOptions {
|
||||
if (@available(iOS 15.0, *)) {
|
||||
AppIconOptionsController *appIconOptionsController = [[AppIconOptionsController alloc] init];
|
||||
UINavigationController *appIconOptionsNavController = [[UINavigationController alloc] initWithRootViewController:appIconOptionsController];
|
||||
[self presentViewController:appIconOptionsNavController animated:YES completion:nil];
|
||||
} else {
|
||||
NSString *systemVersion = [[UIDevice currentDevice] systemVersion];
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Incompatible" message:[NSString stringWithFormat:@"Changing app icons is only available on iOS 15 and later.\nYour Device is currently using iOS %@.", systemVersion] preferredStyle:UIAlertControllerStyleAlert];
|
||||
[alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
|
||||
[self presentViewController:alert animated:YES completion:nil];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)done {
|
||||
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue