88
99#import " PopFliterMenu.h"
1010#import " XHRealTimeBlur.h"
11+ #import " Coding_NetAPIManager.h"
12+ #import " ProjectCount.h"
1113
1214@interface PopFliterMenu ()<UITableViewDataSource,UITableViewDelegate>
1315@property (nonatomic , strong , readwrite ) NSArray *items;
1416@property (nonatomic , strong ) XHRealTimeBlur *realTimeBlur;
1517@property (nonatomic , strong ) UITableView *tableview;
18+ @property (nonatomic , strong ) ProjectCount *pCount;
1619@end
1720
1821@implementation PopFliterMenu
@@ -21,13 +24,24 @@ - (id)initWithFrame:(CGRect)frame items:(NSArray *)items {
2124 self = [super initWithFrame: frame];
2225 if (self) {
2326 // Initialization code
24- self.items = @[@" 1 " , @" 2 " , @" 3 " , @" 4 " ];
25-
27+ self.items = @[@{ @" all " : @" " },@{ @" watched " : @" " },@{ @" created " : @" " },@{ @" joined " : @" " },@{ @" stared " : @" " } ];
28+ self. pCount =[ProjectCount new ];
2629 [self setup ];
2730 }
2831 return self;
2932}
3033
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+
3145// 设置属性
3246- (void )setup {
3347 self.backgroundColor = [UIColor clearColor ];
@@ -39,19 +53,10 @@ - (void)setup {
3953 _realTimeBlur.disMissDuration = 0.5 ;
4054 _realTimeBlur.willShowBlurViewcomplted = ^(void ) {
4155 [[UIApplication sharedApplication ] setStatusBarStyle: UIStatusBarStyleDefault animated: YES ];
42- // weakSelf.isShowed = YES;
43- // [weakSelf showButtons];
4456 };
4557
4658 _realTimeBlur.willDismissBlurViewCompleted = ^(void ) {
4759 [[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];
5560 };
5661 _realTimeBlur.didDismissBlurViewCompleted = ^(BOOL finished) {
5762 [weakSelf removeFromSuperview ];
@@ -83,7 +88,8 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
8388
8489- (UITableViewCell *)tableView : (UITableView *)tableView cellForRowAtIndexPath : (NSIndexPath *)indexPath {
8590 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 ];
8793 return cell;
8894}
8995
0 commit comments