mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +00:00
Alternative Alert Message for LowContrastMode Option
I added an Alternative Alert message if you are using a version lower than v17.33.2. It will instead prompt you with a `Discontinuation` message instead of `Incompatible`
This commit is contained in:
parent
28178722a2
commit
4dbed2d188
1 changed files with 10 additions and 2 deletions
|
|
@ -342,8 +342,16 @@ YTSettingsSectionItem *lowContrastMode = [YTSettingsSectionItemClass
|
|||
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
||||
NSComparisonResult result1 = [appVersion compare:@"17.33.2" options:NSNumericSearch];
|
||||
NSComparisonResult result2 = [appVersion compare:@"17.38.10" options:NSNumericSearch];
|
||||
if (result1 == NSOrderedAscending || result2 == NSOrderedDescending) {
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Incompatibile" message:[NSString stringWithFormat:@"LowContrastMode is only available for app versions v17.33.2-v17.38.10. \nYou are currently using v%@. \n\nWorkaround: if you want to use this then I recommend enabling \"Fix LowContrastMode\" Option.", appVersion] preferredStyle:UIAlertControllerStyleAlert];
|
||||
if (result1 == NSOrderedAscending) {
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Discontinued" message:[NSString stringWithFormat:@"You are using v%@ which is a discontinued version of YouTube that no longer works. Please use v17.33.2-17.38.10 in order to use LowContrastMode.", appVersion] preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
|
||||
[alert addAction:okAction];
|
||||
[settingsViewController presentViewController:alert animated:YES completion:nil];
|
||||
return NO;
|
||||
}
|
||||
else if (result2 == NSOrderedDescending) {
|
||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Incompatibile" message:[NSString stringWithFormat:@"LowContrastMode is only available for app versions v17.33.2-v17.38.10. \nYou are currently using v%@. \n
|
||||
Workaround: if you want to use this then I recommend enabling \"Fix LowContrastMode\" Option.", appVersion] preferredStyle:UIAlertControllerStyleAlert];
|
||||
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
|
||||
[alert addAction:okAction];
|
||||
[settingsViewController presentViewController:alert animated:YES completion:nil];
|
||||
|
|
|
|||
Loading…
Reference in a new issue