8
8
9
9
#import " PopFliterMenu.h"
10
10
#import " XHRealTimeBlur.h"
11
+ #import " Coding_NetAPIManager.h"
12
+ #import " ProjectCount.h"
11
13
12
14
@interface PopFliterMenu ()<UITableViewDataSource,UITableViewDelegate>
13
15
@property (nonatomic , strong , readwrite ) NSArray *items;
14
16
@property (nonatomic , strong ) XHRealTimeBlur *realTimeBlur;
15
17
@property (nonatomic , strong ) UITableView *tableview;
18
+ @property (nonatomic , strong ) ProjectCount *pCount;
16
19
@end
17
20
18
21
@implementation PopFliterMenu
@@ -21,13 +24,24 @@ - (id)initWithFrame:(CGRect)frame items:(NSArray *)items {
21
24
self = [super initWithFrame: frame];
22
25
if (self) {
23
26
// Initialization code
24
- self.items = @[@" 1 " , @" 2 " , @" 3 " , @" 4 " ];
25
-
27
+ self.items = @[@{ @" all " : @" " },@{ @" watched " : @" " },@{ @" created " : @" " },@{ @" joined " : @" " },@{ @" stared " : @" " } ];
28
+ self. pCount =[ProjectCount new ];
26
29
[self setup ];
27
30
}
28
31
return self;
29
32
}
30
33
34
+ - (void )refreshMenuDate
35
+ {
36
+ __weak typeof (self) weakSelf = self;
37
+ [[Coding_NetAPIManager sharedManager ] request_ProjectsCatergoryAndCounts_WithObj: _pCount andBlock: ^(ProjectCount *data, NSError *error) {
38
+ if (data) {
39
+ [weakSelf.pCount configWithProjects: data];
40
+ [weakSelf.tableview reloadData ];
41
+ }
42
+ }];
43
+ }
44
+
31
45
// 设置属性
32
46
- (void )setup {
33
47
self.backgroundColor = [UIColor clearColor ];
@@ -39,19 +53,10 @@ - (void)setup {
39
53
_realTimeBlur.disMissDuration = 0.5 ;
40
54
_realTimeBlur.willShowBlurViewcomplted = ^(void ) {
41
55
[[UIApplication sharedApplication ] setStatusBarStyle: UIStatusBarStyleDefault animated: YES ];
42
- // weakSelf.isShowed = YES;
43
- // [weakSelf showButtons];
44
56
};
45
57
46
58
_realTimeBlur.willDismissBlurViewCompleted = ^(void ) {
47
59
[[UIApplication sharedApplication ] setStatusBarStyle: UIStatusBarStyleLightContent animated: YES ];
48
- // if (weakSelf.selectedItem) {
49
- // if (weakSelf.didSelectedItemCompletion) {
50
- // weakSelf.didSelectedItemCompletion(weakSelf.selectedItem);
51
- // weakSelf.selectedItem = nil;
52
- // }
53
- // }
54
- // [weakSelf hidenButtons];
55
60
};
56
61
_realTimeBlur.didDismissBlurViewCompleted = ^(BOOL finished) {
57
62
[weakSelf removeFromSuperview ];
@@ -83,7 +88,8 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
83
88
84
89
- (UITableViewCell *)tableView : (UITableView *)tableView cellForRowAtIndexPath : (NSIndexPath *)indexPath {
85
90
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: @" UITableViewCell" forIndexPath: indexPath];
86
- cell.textLabel .text =[_items objectAtIndex: indexPath.row];
91
+
92
+ cell.textLabel .text =[[[_items objectAtIndex: indexPath.row] allKeys ] firstObject ];
87
93
return cell;
88
94
}
89
95
0 commit comments