-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathSKStandardController.m
More file actions
102 lines (90 loc) · 3.49 KB
/
SKStandardController.m
File metadata and controls
102 lines (90 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#import "SKStandardController.h"
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
#import "common.h"
@implementation SKStandardController
-(BOOL) showHeartImage { return YES; }
-(BOOL) tintNavigationTitleText { return NO; }
-(BOOL) shiftHeartImage { return YES; }
-(NSString*) enabledDescription { return @"test"; }
-(NSArray*) customSpecifiers
{
return @[
@{ @"cell": @"PSGroupCell",
@"footerText": self.enabledDescription
},
@{
@"cell": @"PSSwitchCell",
@"default": @YES,
@"defaults": self.defaultsFileName,
@"key": @"enabled",
@"label": @"ENABLED",
@"PostNotification": self.postNotification,
@"cellClass": @"SKTintedSwitchCell",
@"icon": @"enabled.png"
},
@{ @"cell": @"PSGroupCell" },
@{
@"cell": @"PSLinkCell",
//@"action": @"loadSettingsListController",
@"detail": self.settingsListControllerClassName,
@"label": @"OPTIONS",
@"icon": @"settings.png",
@"cellClass": @"SKTintedCell",
},
@{ @"cell": @"PSGroupCell" },
@{
@"cell": @"PSLinkCell",
//@"action": @"loadMakersListController",
@"detail": self.makersListControllerClassName,
@"label": @"MAKERS",
@"icon": @"makers.png",
@"cellClass": @"SKTintedCell",
},
@{ @"cell": @"PSGroupCell",
@"footerText": self.footerText, },
@{
@"cell": @"PSLinkCell",
@"action": @"showSupportDialog",
@"label": @"SUPPORT",
@"icon": @"support.png",
@"cellClass": @"SKTintedCell",
},
];
}
-(NSString*)postNotification { return @""; }
-(NSString*)defaultsFileName { return @""; }
-(NSArray*) emailAddresses { return @[]; }
-(NSString*) emailBody { return @""; }
-(NSString*) emailSubject { return @""; }
//-(void) loadSettingsListController { }
//-(void) loadMakersListController { }
-(NSString*) footerText { return @""; }
-(NSString*) settingsListControllerClassName { return @""; }
-(NSString*) makersListControllerClassName { return @""; }
-(void) showSupportDialog
{
MFMailComposeViewController *mailViewController;
if ([MFMailComposeViewController canSendMail])
{
mailViewController = [[MFMailComposeViewController alloc] init];
mailViewController.mailComposeDelegate = self;
[mailViewController setSubject:SK_LCL(self.emailSubject)];
[mailViewController setMessageBody:SK_LCL(self.emailBody) isHTML:NO];
[mailViewController setToRecipients:self.emailAddresses];
[self.rootController presentViewController:mailViewController animated:YES completion:nil];
}
}
-(void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error{
[self dismissViewControllerAnimated:YES completion:NULL];
}
-(UIColor*) iconColor
{
if ([self respondsToSelector:@selector(navigationTintColor)])
return self.navigationTintColor;
if ([self respondsToSelector:@selector(tintColor)])
return self.tintColor;
else
return [UIColor whiteColor];
}
@end