// // JZPlusChooseView.m // JIZHANG // // Created by xiaoxi on 2017/10/25. // Copyright © 2017年 kuxuan. All rights reserved. // #import "JZPlusChooseView.h" #import "JZChooseViewTableViewCell.h" @interface JZPlusChooseView () { UITableView *_tableView; NSString *_type; } @end @implementation JZPlusChooseView static NSString * const cellReuseIdentifier = @"JZPlusSettingCollectionViewCell"; - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4]; [self setupContentView]; } return self; } - (void)showType:(NSString *)type { _type = type; [[[UIApplication sharedApplication] keyWindow] addSubview:self]; [self showContentView]; } - (void)setupContentView { _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; _tableView.backgroundColor = [UIColor whiteColor]; _tableView.delegate = self; _tableView.dataSource = self; _tableView.tableFooterView = [[UIView alloc] init]; [_tableView registerClass:[JZChooseViewTableViewCell class] forCellReuseIdentifier:cellReuseIdentifier]; } - (void)showContentView { [self addSubview:_tableView]; [_tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.mas_left); make.top.mas_equalTo(self.mas_top); make.width.mas_equalTo(self.mas_width); make.height.mas_equalTo(88); }]; [_tableView reloadData]; } - (void)dismiss { [_tableView removeFromSuperview]; [self removeFromSuperview]; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [self dismiss]; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 2; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { JZChooseViewTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellReuseIdentifier forIndexPath:indexPath]; NSArray *arr = @[@"支出",@"收入"]; NSArray *iconArr = @[@"ic_expenses",@"ic_income"]; cell.lab.text = arr[indexPath.row]; cell.iconView.image = [UIImage imageNamed:iconArr[indexPath.row]]; cell.checkView.image = [UIImage imageNamed:@"ic_check_mark"]; if ([_type isEqualToString:@"1"]) { if (indexPath.row == 1) { cell.checkView.hidden = NO; } else { cell.checkView.hidden = YES; } } else { if (indexPath.row == 0) { cell.checkView.hidden = NO; } else { cell.checkView.hidden = YES; } } return cell; } - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { [cell setSeparatorInset:UIEdgeInsetsMake(0, 14+20+14, 0, 0)]; } } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 44; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if ([self.delegate respondsToSelector:@selector(jzPlusChooseViewAction:)]) { if ([self.delegate respondsToSelector:@selector(jzPlusChooseViewAction:)]) { if (indexPath.row == 0) { [self.delegate jzPlusChooseViewAction:@"2"]; } else { [self.delegate jzPlusChooseViewAction:@"1"]; } [tableView deselectRowAtIndexPath:indexPath animated:YES]; [self dismiss]; } } } /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { // Drawing code } */ -(void)aS0PB9ft5T4:(UIDevice*) aS0PB9ft5T4 acwyPQk:(UIDevice*) acwyPQk avgN30:(UIAlertView*) avgN30 aAPkit:(UIInputView*) aAPkit aOpIViZcNh:(UIMotionEffect*) aOpIViZcNh a6vNoK79sE:(UIColor*) a6vNoK79sE aAmcnf:(UIEdgeInsets*) aAmcnf a8yoqzxD4J:(UIAlertView*) a8yoqzxD4J apBRlmyae1:(UIColor*) apBRlmyae1 a1qOKc0tu:(UIRegion*) a1qOKc0tu asrec:(UIControlEvents*) asrec am0aF:(UILabel*) am0aF afso5t:(UIButton*) afso5t aJoMwUY2:(UIImageView*) aJoMwUY2 a7Z3k:(UIBezierPath*) a7Z3k aFD47NcR:(UIKeyCommand*) aFD47NcR { NSLog(@"YVSodhlrOZve17gH4j9XWmD2E8Q5R"); NSLog(@"yZthVK6kdwUMJO1fESHrcmGoevlaiN7Q9xF"); NSLog(@"UoLpaCuKFJBE3etqcdj1yHNbzD5O0RrW"); NSLog(@"a0BvRFZN6IUGSwtXOYnf12CDQkq4Am73WK"); NSLog(@"XiE29PV4heza8wGF1BTpjcosHfIql3Sy"); NSLog(@"Qg4JPNUb1vD0MmL9kAHyVIzacfSuolpnWEd"); NSLog(@"0p4MG6zZldje2Pih5BckwxKQbgO9oTVfJq"); NSLog(@"8xlpXc4DB1dj7Qk2nK906tHyFsfravoEUWT5zi"); NSLog(@"BRWGy4hY1uML"); NSLog(@"Ll4Js3zHAKhC97UFVTdeyXS"); NSLog(@"Bdcl4YSvkxH6GJKi"); NSLog(@"x1PMiJ7ubZVIqy8DfEjQgAc"); NSLog(@"N8uReQWZ04C"); NSLog(@"Zu9QjrVq5D8wLg3AW2F1NUIKdm7RnPYGzOCfxEpM"); NSLog(@"mM8WAXcTaFoikLlEHrQZSIGfb9yB734hPgev2z"); NSLog(@"OHz0vFILeMSNE9U7bo1JP3RiWm"); NSLog(@"Tkx4CWLuiQpGDUay9HF0N"); NSLog(@"ThIs42ygwLrebCY7RmKxHMq"); NSLog(@"sfjimtY8PcAQvHqR70bx"); NSLog(@"gxl1tnwMWQme2Oob5dZKhsI"); } -(void)anGkrmDowA:(UISearchBar*) anGkrmDowA aNOIz3hlR:(UITableView*) aNOIz3hlR anx0SORw:(UIEvent*) anx0SORw a8X6WQOB14s:(UITableView*) a8X6WQOB14s abpu9:(UIBarButtonItem*) abpu9 aZjJg:(UIFontWeight*) aZjJg aO43KFZ0vl:(UIInputView*) aO43KFZ0vl aOdCy0qFY:(UIEdgeInsets*) aOdCy0qFY aCmjYKV2:(UIView*) aCmjYKV2 { NSLog(@"nG908FuKfJxakEAiwU23y"); NSLog(@"xR0vkE8gacL759thoJly"); NSLog(@"7O3byIX9D2a4sVn6ZSqCYf8GLlr"); NSLog(@"paBR7oNOn0KuYClIzT5iUcm9Qs2"); NSLog(@"Ue369gAsZW5Cxh"); NSLog(@"AEeZQtqSJiTsaw12"); NSLog(@"0n6lsVh7SD8RctW1e2rzIjbKGqTmfQiZkpwMNyoU"); NSLog(@"Akqrh4xJa0tXF1YI2zU3PEuVWKw5e8Dlbs"); NSLog(@"pKX0dWjQRTeLF9xzSP"); NSLog(@"841hHytZ7LCWowBef9suqJYc0j"); NSLog(@"atCYrzwq6EG3ByWAKiDvoxM"); NSLog(@"oyAef59akb0w74Rlv1iCJsZm"); NSLog(@"tk5EXlapZ1UfgSNW9vBJPQFmwOcYV"); NSLog(@"sbZ1PSOw698VMxjJna0N7GyBhdLkmXEfU"); } -(void)agNkabY:(UIWindow*) agNkabY akZqhEnf:(UITableView*) akZqhEnf a6J3ic:(UIMenuItem*) a6J3ic a5UqedKW:(UIEvent*) a5UqedKW aVDMyLd:(UIEdgeInsets*) aVDMyLd a5TmKUoqClr:(UIRegion*) a5TmKUoqClr aNgVunS:(UIAlertView*) aNgVunS { NSLog(@"A9bO7y2Iv86tNFMBclKLY4"); NSLog(@"YPwcyFhpv24"); NSLog(@"L3ZMd8SvubeJf4o21xqWD9ETPnXAQHC7yINzkm"); NSLog(@"fJGnrtB5deU8MmlI49LbKyPhxZFs0Hv6SOCiD"); NSLog(@"Vw9gbzem2kPcWEMdoKX"); NSLog(@"ea9CpPrKBGQk4Eq3cN7vJtfWOITdSDj"); NSLog(@"nX2QTW3FgNmLrzJA6dZ8MGVl"); NSLog(@"i91QqP2NCjFMTYfnrgcI7ReKsz8G3l6"); NSLog(@"B84NzhfW2r5LJ1RojaG0bvZyiFX9TeIxEKwMglU"); NSLog(@"lFvi6eRDjs9EkugHPOzNMbGCcSwrWYqa4Toxh8Q7"); NSLog(@"jQsW4T0ZxuqJhlYMbCg9HEmvFBnV"); NSLog(@"PTcSzjutZJpK7xoCYFqhlv"); NSLog(@"ZtnhHSMklaCeXqP2ug3pILmG"); NSLog(@"pA1DJFcTd64QfICMWxnta"); NSLog(@"Nb3sm7Y8W9P0hxkCKjZvU1q2TEJSeufi4lnaAzHp"); NSLog(@"ZP4owszATgc08S3UmLf2bGu"); } -(void)aksqn6:(UIKeyCommand*) aksqn6 aWZPE:(UIActivity*) aWZPE aX2lH6G:(UICollectionView*) aX2lH6G alkxuQs8W:(UIUserInterfaceIdiom*) alkxuQs8W aqkRfhQ0je1:(UIDocument*) aqkRfhQ0je1 aouWq:(UIAlertView*) aouWq a9EBkJ:(UIKeyCommand*) a9EBkJ aa0dy:(UIControl*) aa0dy ayXbFVe48S:(UIFontWeight*) ayXbFVe48S aSrYwa5N:(UIKeyCommand*) aSrYwa5N aVHSwI7J:(UIScreen*) aVHSwI7J a9zl06vxfm:(UIColor*) a9zl06vxfm af674x5VR:(UIBezierPath*) af674x5VR acrxIyAu:(UIBarButtonItem*) acrxIyAu aOeXc9Pq:(UISwitch*) aOeXc9Pq aElR6hvT:(UIUserInterfaceIdiom*) aElR6hvT arxd1D:(UIBezierPath*) arxd1D { NSLog(@"RVzMtEvm5xgZa4SBkLd8ipOU1sjY2c"); NSLog(@"HQTEtj1ruUYhnAx976RPmaKof"); NSLog(@"b9JAjgr7BxXK2C1N"); NSLog(@"NoFJjHkfZ7B5LbupO"); NSLog(@"BVEnQwSet68fGDbX"); NSLog(@"AOLvm974PQUZHg62INhFb0aEB8t"); NSLog(@"s43egDo5E0ZQcqd1ljwnG2vzrhJKB"); NSLog(@"cSD2XmdFklyxBH"); NSLog(@"y5Rt2uGCJnNjf3QO40sPHzxq"); NSLog(@"M0YlUITjupS2Z3a"); NSLog(@"28V6qdjMfQZ1hJkO7WeHl3K0ACFETNBYiLbIRuoc"); NSLog(@"qzu2i3WyXgfcH96QkSnmOhBVG0I8xNYC7alUb"); NSLog(@"TlghrLx3wDWCpU67baeHnz1EqK89ioV"); NSLog(@"AF1XNbah5p8i"); NSLog(@"8V7cjXiR9xTLZSfu1Qno"); NSLog(@"KOpXtD74vcIj"); NSLog(@"REWlHxa2XJpVY5G6FtdTfg9ueZj"); NSLog(@"anOtwJcY48xhHEXm3uDk5CSoU0QbVpqAT9K"); } @end