mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-21 16:02:00 +00:00
Fix bug and add docs
This commit is contained in:
parent
31590df8f9
commit
a2848bd3d3
1 changed files with 24 additions and 1 deletions
|
|
@ -48,6 +48,29 @@
|
||||||
} \
|
} \
|
||||||
settingItemId:0]]
|
settingItemId:0]]
|
||||||
|
|
||||||
|
/** Example SWITCH_ITEM3 Usage
|
||||||
|
SWITCH_ITEM3(
|
||||||
|
LOC(@"Your title here"),
|
||||||
|
LOC(@"Your description here"),
|
||||||
|
@"yourKey_enabled",
|
||||||
|
// Custom code goes in this block, wrapped in ({...}); Make sure to return YES at the end
|
||||||
|
({
|
||||||
|
// Show an alert if this setting is being enabled
|
||||||
|
if (enable) {
|
||||||
|
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Warning" message:@"Some alert message here" preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
|
||||||
|
[alert addAction:okAction];
|
||||||
|
[settingsViewController presentViewController:alert animated:YES completion:nil];
|
||||||
|
}
|
||||||
|
// Update the setting in the storage and reload
|
||||||
|
[[NSUserDefaults standardUserDefaults] setBool:enable forKey:@"yourKey_enabled"];
|
||||||
|
[settingsViewController reloadData];
|
||||||
|
SHOW_RELAUNCH_YT_SNACKBAR;
|
||||||
|
return YES;
|
||||||
|
});
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
static int contrastMode() {
|
static int contrastMode() {
|
||||||
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
||||||
|
|
@ -451,7 +474,7 @@ extern NSBundle *uYouPlusBundle();
|
||||||
SWITCH_ITEM3(
|
SWITCH_ITEM3(
|
||||||
LOC(@"Enable Specific UI Related Options (YTNoModernUI)"),
|
LOC(@"Enable Specific UI Related Options (YTNoModernUI)"),
|
||||||
LOC(@"This will enable other options to give it a less-modern feeling. App restart is required."),
|
LOC(@"This will enable other options to give it a less-modern feeling. App restart is required."),
|
||||||
@"ytNoModernUI_enabled"
|
@"ytNoModernUI_enabled",
|
||||||
({
|
({
|
||||||
if (enable) {
|
if (enable) {
|
||||||
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Warning" message:@"This will force-enable other settings on restart. To disable them, you must turn this setting off." preferredStyle:UIAlertControllerStyleAlert];
|
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Warning" message:@"This will force-enable other settings on restart. To disable them, you must turn this setting off." preferredStyle:UIAlertControllerStyleAlert];
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue