lanekit 0.3.5 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +14 -2
- data/lib/lanekit/generate/model.rb +2 -0
- data/lib/lanekit/generate/provider.rb +3 -3
- data/lib/lanekit/generate/tableviewcontroller.rb +110 -0
- data/lib/lanekit/generate.rb +1 -0
- data/lib/lanekit/version.rb +1 -1
- data/lib/lanekit.rb +15 -0
- data/lib/template/LKFeedCell.h.erb +16 -0
- data/lib/template/LKFeedCell.m.erb +148 -0
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Controllers/LKAppDelegate.m +4 -6
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Resources/Base.lproj/Main_iPad.storyboard +3 -116
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Resources/Base.lproj/Main_iPhone.storyboard +4 -82
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Resources/placeholder@2x.png +0 -0
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project.xcodeproj/project.pbxproj +4 -12
- data/lib/template/lanekit-ios-project/lanekit-ios-project.xcworkspace/xcuserdata/larry.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- data/lib/template/model.m.erb +8 -0
- data/lib/template/model_base.h.erb +2 -0
- data/lib/template/model_base.m.erb +30 -0
- data/lib/template/tvc.h.erb +14 -0
- data/lib/template/tvc.m.erb +158 -0
- metadata +14 -12
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Controllers/LKDetailViewController.h +0 -12
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Controllers/LKDetailViewController.m +0 -68
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Controllers/LKMasterViewController.h +0 -13
- data/lib/template/lanekit-ios-project/lanekit-ios-project/lanekit-ios-project/Controllers/LKMasterViewController.m +0 -122
@@ -1,122 +0,0 @@
|
|
1
|
-
//
|
2
|
-
// LKMasterViewController.m
|
3
|
-
//
|
4
|
-
|
5
|
-
#import "LKMasterViewController.h"
|
6
|
-
|
7
|
-
#import "LKDetailViewController.h"
|
8
|
-
|
9
|
-
@interface LKMasterViewController () {
|
10
|
-
NSMutableArray *_objects;
|
11
|
-
}
|
12
|
-
@end
|
13
|
-
|
14
|
-
@implementation LKMasterViewController
|
15
|
-
|
16
|
-
- (void)awakeFromNib
|
17
|
-
{
|
18
|
-
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
19
|
-
self.clearsSelectionOnViewWillAppear = NO;
|
20
|
-
self.preferredContentSize = CGSizeMake(320.0, 600.0);
|
21
|
-
}
|
22
|
-
[super awakeFromNib];
|
23
|
-
}
|
24
|
-
|
25
|
-
- (void)viewDidLoad
|
26
|
-
{
|
27
|
-
[super viewDidLoad];
|
28
|
-
// Do any additional setup after loading the view, typically from a nib.
|
29
|
-
self.navigationItem.leftBarButtonItem = self.editButtonItem;
|
30
|
-
|
31
|
-
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
|
32
|
-
self.navigationItem.rightBarButtonItem = addButton;
|
33
|
-
self.detailViewController = (LKDetailViewController *)[[self.splitViewController.viewControllers lastObject] topViewController];
|
34
|
-
}
|
35
|
-
|
36
|
-
- (void)didReceiveMemoryWarning
|
37
|
-
{
|
38
|
-
[super didReceiveMemoryWarning];
|
39
|
-
// Dispose of any resources that can be recreated.
|
40
|
-
}
|
41
|
-
|
42
|
-
- (void)insertNewObject:(id)sender
|
43
|
-
{
|
44
|
-
if (!_objects) {
|
45
|
-
_objects = [[NSMutableArray alloc] init];
|
46
|
-
}
|
47
|
-
[_objects insertObject:[NSDate date] atIndex:0];
|
48
|
-
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
|
49
|
-
[self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
|
50
|
-
}
|
51
|
-
|
52
|
-
#pragma mark - Table View
|
53
|
-
|
54
|
-
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
55
|
-
{
|
56
|
-
return 1;
|
57
|
-
}
|
58
|
-
|
59
|
-
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
60
|
-
{
|
61
|
-
return _objects.count;
|
62
|
-
}
|
63
|
-
|
64
|
-
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
|
65
|
-
{
|
66
|
-
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
|
67
|
-
|
68
|
-
NSDate *object = _objects[indexPath.row];
|
69
|
-
cell.textLabel.text = [object description];
|
70
|
-
return cell;
|
71
|
-
}
|
72
|
-
|
73
|
-
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
|
74
|
-
{
|
75
|
-
// Return NO if you do not want the specified item to be editable.
|
76
|
-
return YES;
|
77
|
-
}
|
78
|
-
|
79
|
-
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
|
80
|
-
{
|
81
|
-
if (editingStyle == UITableViewCellEditingStyleDelete) {
|
82
|
-
[_objects removeObjectAtIndex:indexPath.row];
|
83
|
-
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
|
84
|
-
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
|
85
|
-
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
|
86
|
-
}
|
87
|
-
}
|
88
|
-
|
89
|
-
/*
|
90
|
-
// Override to support rearranging the table view.
|
91
|
-
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
|
92
|
-
{
|
93
|
-
}
|
94
|
-
*/
|
95
|
-
|
96
|
-
/*
|
97
|
-
// Override to support conditional rearranging of the table view.
|
98
|
-
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
|
99
|
-
{
|
100
|
-
// Return NO if you do not want the item to be re-orderable.
|
101
|
-
return YES;
|
102
|
-
}
|
103
|
-
*/
|
104
|
-
|
105
|
-
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
106
|
-
{
|
107
|
-
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
|
108
|
-
NSDate *object = _objects[indexPath.row];
|
109
|
-
self.detailViewController.detailItem = object;
|
110
|
-
}
|
111
|
-
}
|
112
|
-
|
113
|
-
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
|
114
|
-
{
|
115
|
-
if ([[segue identifier] isEqualToString:@"showDetail"]) {
|
116
|
-
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
|
117
|
-
NSDate *object = _objects[indexPath.row];
|
118
|
-
[[segue destinationViewController] setDetailItem:object];
|
119
|
-
}
|
120
|
-
}
|
121
|
-
|
122
|
-
@end
|