-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC78ECD15-512C-4BEA-BFAA-1F4DF8F0E7DC.codesnippet
167 lines (141 loc) · 4.52 KB
/
C78ECD15-512C-4BEA-BFAA-1F4DF8F0E7DC.codesnippet
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDECodeSnippetCompletionPrefix</key>
<string>vclife</string>
<key>IDECodeSnippetCompletionScopes</key>
<array>
<string>All</string>
</array>
<key>IDECodeSnippetContents</key>
<string>
{ UITableView *_tableView;
NSMutableArray *_dataSource;
NSInteger pageNum,pageSize;
BOOL isLoadMore;
}
#pragma mark ==== viewcontroller lifeCycle===
- (void)dealloc{
_dataSource = nil;
_tableView = nil;
}
- (void)viewDidLoad{
[super viewDidLoad];
self.view.backgroundColor = kBgColor;
[self initData];
[self viewDidCreateUI];
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:0 animated:1];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
#pragma mark ====initData=====
- (void)initData{
_dataSource = [NSMutableArray arrayWithCapacity:1];
pageNum = 0;
pageSize = 10;
}
//- (void)backAction{
//
//}
//- (void)rightAciton{
//
//}
#pragma mark ====CreateUI====
- (void)viewDidCreateUI{
[self viewCreateNavigationBar];
[self viewLayoutUI];
}
- (void)viewCreateNavigationBar{
}
- (void)viewLayoutUI{
[self createTableView];
}
-(void)createTableView{
UIView * tabFooter = [AppTools createViewFrame:CGRectMake(0, 0, kScreenWidth, kUIGap/kUISize) backgroundColor:kRColor(245)];
_tableView = [AppTools crtTv:CGRectMake(0, 0, kScreenWidth, kScreenHeight) style:UITableViewStylePlain showsHorizontalScrollIndicator:0 showsVerticalScrollIndicator:0 dele:self headerView:nil footerView:tabFooter];
_tableView.separatorStyle=UITableViewCellSeparatorStyleSingleLine;
_tableView.separatorInset = UIEdgeInsetsZero;
_tableView.backgroundColor = kRColor(254);
[_tableView setSeparatorColor:kRColor(226)];
// _tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
//
// NSLog(@"********初始化**********");
// [_dataSource removeAllObjects];
//[_tableView reloadData];
// [self onlineCharge];
// [_tableView.mj_header endRefreshing];
//
// }];
// [_tableView.mj_header beginRefreshing];
// _tableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMoreData)];
[self.view addSubview:_tableView];
}
#pragma mark ==== download dataSource====
- (void)loadMoreData{
}
#pragma mark ViewFunctionDele
- (void)pushTo:(id)view controller:(UIViewController *)vc{
if (nil!=vc) {
[self.navigationController pushViewController:vc animated:YES];
}
return;
}
- (void)modalTo:(id)view controller:(UIViewController *)vc{
if (nil!=vc) {
}
return;
}
- (void)tableViewReloadByCell:(id)cell controller:(UIViewController *)vc{
[_tableView.mj_header beginRefreshing];
}
#pragma mark tableView dele
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return nil!=_dataSource&&_dataSource.count >0?_dataSource.count:0;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return _dataSource.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 0/kUISize;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
// MyNeedsCell * cell = [tableView dequeueReusableCellWithIdentifier:MyNeedsCellReuse];;
// [cell UI];
// __weak id weakSelf = self;
// cell.cellDele = weakSelf;
// if (!cell) {
// cell = [[MyNeedsCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:MyNeedsCellReuse];
//
// }
// @try {
//
// [cell cellRefresh:ds[indexPath.row]];
//
// } @catch (NSException *exception) {
//
// } @finally {
//
// }
// return cell;
return nil;
}
</string>
<key>IDECodeSnippetIdentifier</key>
<string>C78ECD15-512C-4BEA-BFAA-1F4DF8F0E7DC</string>
<key>IDECodeSnippetLanguage</key>
<string>Xcode.SourceCodeLanguage.Objective-C</string>
<key>IDECodeSnippetSummary</key>
<string>vclife</string>
<key>IDECodeSnippetTitle</key>
<string>ViewConroller's lifecycle</string>
<key>IDECodeSnippetUserSnippet</key>
<true/>
<key>IDECodeSnippetVersion</key>
<integer>2</integer>
</dict>
</plist>