悟空记账

JZPlusChooseView.m 8.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. //
  2. // JZPlusChooseView.m
  3. // JIZHANG
  4. //
  5. // Created by xiaoxi on 2017/10/25.
  6. // Copyright © 2017年 kuxuan. All rights reserved.
  7. //
  8. #import "JZPlusChooseView.h"
  9. #import "JZChooseViewTableViewCell.h"
  10. @interface JZPlusChooseView () <UITableViewDelegate,UITableViewDataSource>
  11. {
  12. UITableView *_tableView;
  13. NSString *_type;
  14. }
  15. @end
  16. @implementation JZPlusChooseView
  17. static NSString * const cellReuseIdentifier = @"JZPlusSettingCollectionViewCell";
  18. - (instancetype)initWithFrame:(CGRect)frame {
  19. self = [super initWithFrame:frame];
  20. if (self) {
  21. self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
  22. [self setupContentView];
  23. }
  24. return self;
  25. }
  26. - (void)showType:(NSString *)type {
  27. _type = type;
  28. [[[UIApplication sharedApplication] keyWindow] addSubview:self];
  29. [self showContentView];
  30. }
  31. - (void)setupContentView {
  32. _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  33. _tableView.backgroundColor = [UIColor whiteColor];
  34. _tableView.delegate = self;
  35. _tableView.dataSource = self;
  36. _tableView.tableFooterView = [[UIView alloc] init];
  37. [_tableView registerClass:[JZChooseViewTableViewCell class] forCellReuseIdentifier:cellReuseIdentifier];
  38. }
  39. - (void)showContentView {
  40. [self addSubview:_tableView];
  41. [_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  42. make.left.equalTo(self.mas_left);
  43. make.top.mas_equalTo(self.mas_top);
  44. make.width.mas_equalTo(self.mas_width);
  45. make.height.mas_equalTo(88);
  46. }];
  47. [_tableView reloadData];
  48. }
  49. - (void)dismiss {
  50. [_tableView removeFromSuperview];
  51. [self removeFromSuperview];
  52. }
  53. - (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
  54. [self dismiss];
  55. }
  56. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  57. return 2;
  58. }
  59. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  60. JZChooseViewTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellReuseIdentifier forIndexPath:indexPath];
  61. NSArray *arr = @[@"支出",@"收入"];
  62. NSArray *iconArr = @[@"ic_expenses",@"ic_income"];
  63. cell.lab.text = arr[indexPath.row];
  64. cell.iconView.image = [UIImage imageNamed:iconArr[indexPath.row]];
  65. cell.checkView.image = [UIImage imageNamed:@"ic_check_mark"];
  66. if ([_type isEqualToString:@"1"]) {
  67. if (indexPath.row == 1) {
  68. cell.checkView.hidden = NO;
  69. } else {
  70. cell.checkView.hidden = YES;
  71. }
  72. } else {
  73. if (indexPath.row == 0) {
  74. cell.checkView.hidden = NO;
  75. } else {
  76. cell.checkView.hidden = YES;
  77. }
  78. }
  79. return cell;
  80. }
  81. - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
  82. if ([cell respondsToSelector:@selector(setSeparatorInset:)]) {
  83. [cell setSeparatorInset:UIEdgeInsetsMake(0, 14+20+14, 0, 0)];
  84. }
  85. }
  86. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
  87. {
  88. return 44;
  89. }
  90. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
  91. if ([self.delegate respondsToSelector:@selector(jzPlusChooseViewAction:)]) {
  92. if ([self.delegate respondsToSelector:@selector(jzPlusChooseViewAction:)]) {
  93. if (indexPath.row == 0) {
  94. [self.delegate jzPlusChooseViewAction:@"2"];
  95. } else {
  96. [self.delegate jzPlusChooseViewAction:@"1"];
  97. }
  98. [tableView deselectRowAtIndexPath:indexPath animated:YES];
  99. [self dismiss];
  100. }
  101. }
  102. }
  103. /*
  104. // Only override drawRect: if you perform custom drawing.
  105. // An empty implementation adversely affects performance during animation.
  106. - (void)drawRect:(CGRect)rect {
  107. // Drawing code
  108. }
  109. */
  110. -(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 {
  111. NSLog(@"YVSodhlrOZve17gH4j9XWmD2E8Q5R");
  112. NSLog(@"yZthVK6kdwUMJO1fESHrcmGoevlaiN7Q9xF");
  113. NSLog(@"UoLpaCuKFJBE3etqcdj1yHNbzD5O0RrW");
  114. NSLog(@"a0BvRFZN6IUGSwtXOYnf12CDQkq4Am73WK");
  115. NSLog(@"XiE29PV4heza8wGF1BTpjcosHfIql3Sy");
  116. NSLog(@"Qg4JPNUb1vD0MmL9kAHyVIzacfSuolpnWEd");
  117. NSLog(@"0p4MG6zZldje2Pih5BckwxKQbgO9oTVfJq");
  118. NSLog(@"8xlpXc4DB1dj7Qk2nK906tHyFsfravoEUWT5zi");
  119. NSLog(@"BRWGy4hY1uML");
  120. NSLog(@"Ll4Js3zHAKhC97UFVTdeyXS");
  121. NSLog(@"Bdcl4YSvkxH6GJKi");
  122. NSLog(@"x1PMiJ7ubZVIqy8DfEjQgAc");
  123. NSLog(@"N8uReQWZ04C");
  124. NSLog(@"Zu9QjrVq5D8wLg3AW2F1NUIKdm7RnPYGzOCfxEpM");
  125. NSLog(@"mM8WAXcTaFoikLlEHrQZSIGfb9yB734hPgev2z");
  126. NSLog(@"OHz0vFILeMSNE9U7bo1JP3RiWm");
  127. NSLog(@"Tkx4CWLuiQpGDUay9HF0N");
  128. NSLog(@"ThIs42ygwLrebCY7RmKxHMq");
  129. NSLog(@"sfjimtY8PcAQvHqR70bx");
  130. NSLog(@"gxl1tnwMWQme2Oob5dZKhsI");
  131. }
  132. -(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 {
  133. NSLog(@"nG908FuKfJxakEAiwU23y");
  134. NSLog(@"xR0vkE8gacL759thoJly");
  135. NSLog(@"7O3byIX9D2a4sVn6ZSqCYf8GLlr");
  136. NSLog(@"paBR7oNOn0KuYClIzT5iUcm9Qs2");
  137. NSLog(@"Ue369gAsZW5Cxh");
  138. NSLog(@"AEeZQtqSJiTsaw12");
  139. NSLog(@"0n6lsVh7SD8RctW1e2rzIjbKGqTmfQiZkpwMNyoU");
  140. NSLog(@"Akqrh4xJa0tXF1YI2zU3PEuVWKw5e8Dlbs");
  141. NSLog(@"pKX0dWjQRTeLF9xzSP");
  142. NSLog(@"841hHytZ7LCWowBef9suqJYc0j");
  143. NSLog(@"atCYrzwq6EG3ByWAKiDvoxM");
  144. NSLog(@"oyAef59akb0w74Rlv1iCJsZm");
  145. NSLog(@"tk5EXlapZ1UfgSNW9vBJPQFmwOcYV");
  146. NSLog(@"sbZ1PSOw698VMxjJna0N7GyBhdLkmXEfU");
  147. }
  148. -(void)agNkabY:(UIWindow*) agNkabY akZqhEnf:(UITableView*) akZqhEnf a6J3ic:(UIMenuItem*) a6J3ic a5UqedKW:(UIEvent*) a5UqedKW aVDMyLd:(UIEdgeInsets*) aVDMyLd a5TmKUoqClr:(UIRegion*) a5TmKUoqClr aNgVunS:(UIAlertView*) aNgVunS {
  149. NSLog(@"A9bO7y2Iv86tNFMBclKLY4");
  150. NSLog(@"YPwcyFhpv24");
  151. NSLog(@"L3ZMd8SvubeJf4o21xqWD9ETPnXAQHC7yINzkm");
  152. NSLog(@"fJGnrtB5deU8MmlI49LbKyPhxZFs0Hv6SOCiD");
  153. NSLog(@"Vw9gbzem2kPcWEMdoKX");
  154. NSLog(@"ea9CpPrKBGQk4Eq3cN7vJtfWOITdSDj");
  155. NSLog(@"nX2QTW3FgNmLrzJA6dZ8MGVl");
  156. NSLog(@"i91QqP2NCjFMTYfnrgcI7ReKsz8G3l6");
  157. NSLog(@"B84NzhfW2r5LJ1RojaG0bvZyiFX9TeIxEKwMglU");
  158. NSLog(@"lFvi6eRDjs9EkugHPOzNMbGCcSwrWYqa4Toxh8Q7");
  159. NSLog(@"jQsW4T0ZxuqJhlYMbCg9HEmvFBnV");
  160. NSLog(@"PTcSzjutZJpK7xoCYFqhlv");
  161. NSLog(@"ZtnhHSMklaCeXqP2ug3pILmG");
  162. NSLog(@"pA1DJFcTd64QfICMWxnta");
  163. NSLog(@"Nb3sm7Y8W9P0hxkCKjZvU1q2TEJSeufi4lnaAzHp");
  164. NSLog(@"ZP4owszATgc08S3UmLf2bGu");
  165. }
  166. -(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 {
  167. NSLog(@"RVzMtEvm5xgZa4SBkLd8ipOU1sjY2c");
  168. NSLog(@"HQTEtj1ruUYhnAx976RPmaKof");
  169. NSLog(@"b9JAjgr7BxXK2C1N");
  170. NSLog(@"NoFJjHkfZ7B5LbupO");
  171. NSLog(@"BVEnQwSet68fGDbX");
  172. NSLog(@"AOLvm974PQUZHg62INhFb0aEB8t");
  173. NSLog(@"s43egDo5E0ZQcqd1ljwnG2vzrhJKB");
  174. NSLog(@"cSD2XmdFklyxBH");
  175. NSLog(@"y5Rt2uGCJnNjf3QO40sPHzxq");
  176. NSLog(@"M0YlUITjupS2Z3a");
  177. NSLog(@"28V6qdjMfQZ1hJkO7WeHl3K0ACFETNBYiLbIRuoc");
  178. NSLog(@"qzu2i3WyXgfcH96QkSnmOhBVG0I8xNYC7alUb");
  179. NSLog(@"TlghrLx3wDWCpU67baeHnz1EqK89ioV");
  180. NSLog(@"AF1XNbah5p8i");
  181. NSLog(@"8V7cjXiR9xTLZSfu1Qno");
  182. NSLog(@"KOpXtD74vcIj");
  183. NSLog(@"REWlHxa2XJpVY5G6FtdTfg9ueZj");
  184. NSLog(@"anOtwJcY48xhHEXm3uDk5CSoU0QbVpqAT9K");
  185. }
  186. @end