123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #import "DDBSettingsController.h"
- @implementation DDBSettingsController
- - (id)loadSettingGroups {
-
- /*
-
- +[<TSKSettingItem: 0x1ad71bc88> toggleItemWithTitle:Automatically Update Apps description:(null) representedObject:<TVSettingsPreferenceFacade: 0x1c0438480> keyPath:AutoUpdatesEnabled onTitle:(null) offTitle:(null)]
- */
- NSLog(@"DDBSettings: main bundle: %@", [NSBundle bundleForClass:self.class]);
-
- id facade = [[NSClassFromString(@"TVSettingsPreferenceFacade") alloc] initWithDomain:@"com.nito.dalesdeadbug" notifyChanges:TRUE];
- [facade setValue:[NSNumber numberWithBool:TRUE] forUndefinedKey:@"Enabled"];
- [facade setValue:@"11.1" forUndefinedKey:@"SpoofVersion"];
-
- NSMutableArray *_backingArray = [NSMutableArray new];
- TSKSettingItem *toggleItem = [TSKSettingItem toggleItemWithTitle:@"Version spoofing" description:@"Whether or not to spoof a higher OS version to install officially unsupported application versions. " representedObject:facade keyPath:@"Enabled" onTitle:nil offTitle:nil];
- //TSKSettingItem *textEntryItem = [TSKSettingItem textInputItemWithTitle:@"Tests text entry" description:@"This is a test" representedObject:facade keyPath:@"textTest"];
- TSKSettingItem *multiItem = [TSKSettingItem multiValueItemWithTitle:@"Spoofed Version" description:@"The version you are going to spoof." representedObject:facade keyPath:@"SpoofVersion" availableValues:@[@"11.1", @"11.2", @"11.3", @"11.4"]];
- TSKSettingGroup *group = [TSKSettingGroup groupWithTitle:nil settingItems:@[toggleItem, multiItem]];
- [_backingArray addObject:group];
- [self setValue:_backingArray forKey:@"_settingGroups"];
-
- return _backingArray;
-
- }
- -(id)previewForItemAtIndexPath:(NSIndexPath *)indexPath {
-
- NSLog(@"are we ever in ehre?!??!");
- TSKPreviewViewController *item = [super previewForItemAtIndexPath:indexPath];
- TSKSettingGroup *currentGroup = self.settingGroups[indexPath.section];
- NSLog(@"currentGroup: %@", currentGroup);
- TSKSettingItem *currentItem = currentGroup.settingItems[indexPath.row];
- NSLog(@"current item: %@", currentItem);
- NSString *imagePath = [[NSBundle bundleForClass:self.class] pathForResource:@"icon" ofType:@"jpg"];
- UIImage *icon = [UIImage imageWithContentsOfFile:imagePath];
- NSLog(@"DDBSettings: our icon: %@", imagePath);
- if (icon != nil) {
- TSKVibrantImageView *imageView = [[TSKVibrantImageView alloc] initWithImage:icon];
- NSLog(@"current item: %@", imageView);
- [item setContentView:imageView];
- }
- NSLog(@"previewForItemAtIndexPath: %@", item);
-
- return item;
-
- }
- @end
|