forked from soffes/cheddar-ios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CDISettingsTapPickerViewController.m
65 lines (51 loc) · 1.98 KB
/
CDISettingsTapPickerViewController.m
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
//
// CDISettingsTapPickerViewController.m
// Cheddar for iOS
//
// Created by Sam Soffes on 7/29/12.
// Copyright (c) 2012 Nothing Magical. All rights reserved.
//
#import "CDISettingsTapPickerViewController.h"
#import "UIColor+CheddariOSAdditions.h"
#import "UIFont+CheddariOSAdditions.h"
NSString *const kCDITapActionDefaultsKey = @"CDITapActionDefaults";
NSString *const kCDITapActionNothingKey = @"CDITapActionNothing";
NSString *const kCDITapActionCompleteKey = @"CDITapActionComplete";
NSString *const kCDITapActionEditKey = @"CDITapActionEdit";
@implementation CDISettingsTapPickerViewController
#pragma mark - Class Methods
+ (NSString *)defaultsKey {
return kCDITapActionDefaultsKey;
}
+ (NSDictionary *)valueMap {
static NSDictionary *map = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
map = [[NSDictionary alloc] initWithObjectsAndKeys:
@"Nothing", kCDITapActionNothingKey,
@"Complete", kCDITapActionCompleteKey,
@"Edit", kCDITapActionEditKey,
nil];
});
return map;
}
- (NSArray *)keys {
return [[NSArray alloc] initWithObjects:kCDITapActionNothingKey, kCDITapActionCompleteKey, kCDITapActionEditKey, nil];
}
#pragma mark - UIViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Tap Action";
SSLabel *footer = [[SSLabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.view.frame.size.width, 80.0f)];
CGFloat inset = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ? 10.0f : 30.0f;
footer.textEdgeInsets = UIEdgeInsetsMake(0.0f, inset, 0.0f, inset);
footer.verticalTextAlignment = SSLabelVerticalTextAlignmentTop;
footer.backgroundColor = [UIColor clearColor];
footer.textColor = [UIColor cheddarLightTextColor];
footer.font = [UIFont cheddarInterfaceFontOfSize:14.0f];
footer.textAlignment = UITextAlignmentCenter;
footer.numberOfLines = 0;
footer.text = @"Change what action tapping a task preforms. Tapping the checkbox will always toggle completion.";
self.tableView.tableFooterView = footer;
}
@end