Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import <AudioToolbox/AudioToolbox.h>
- #import "FRPreferences/FRPrefs.h"
- #define TWPlusTintColour [UIColor colorWithRed:46/255.0f green:205/255.0f blue:113/255.0f alpha:1.0f]
- @interface T1SettingsViewController : UIViewController
- @end
- static NSString *segmentSelection;
- static FRPSegmentCell *segmentCell = [FRPSegmentCell cellWithTitle:@"Segment Cell"
- setting:[FRPSettings settingsWithKey:@"SegmentValue" defaultValue:@"1519"]
- values:@[@"1519",@"1520",@"1521"]
- displayedValues:@[@"Peek",@"Pop",@"Nope"]
- postNotification:nil
- changeBlock:^(NSString *item) {
- NSLog(@"Selected Item: %@",item);
- }];
- %hook T1SettingsViewController
- -(void)viewDidLoad
- {
- %orig;
- UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:@"TWPlus" style:UIBarButtonItemStylePlain target:self action:@selector(loadNewSettings:)];
- [self.navigationItem setRightBarButtonItem:addButton];
- %orig;
- }
- %new
- - (void)loadNewSettings:(id)sender {
- FRPSection *section1 = [FRPSection sectionWithTitle:@"TWPlus" footer:nil];
- /***** Removed old code from here ***/
- [section1 addCell:segmentCell];
- FRPreferences *table = [FRPreferences tableWithSections:@[section1] title:@"TWPlus" tintColor:TWPlusTintColour];
- [self.navigationController pushViewController:table animated:YES];
- }
- %end
- %hook T1DashAccountSwitcherBubble
- - (void)wasTapped:(id)arg1 {
- %orig;
- segmentSelection =[segmentCell objectForKey:@"SegmentValue"];
- if([segmentSelection isEqualToString:@"1519"]) {
- AudioServicesPlaySystemSound(1519);}
- if([segmentSelection isEqualToString:@"1520"]) {
- AudioServicesPlaySystemSound(1520);}
- if([segmentSelection isEqualToString:@"1521"]) {
- AudioServicesPlaySystemSound(1521);}
- }
- %end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement