|
@@ -14,7 +14,6 @@
|
|
|
@property (nonatomic, strong) KWSearchMainTypeTableView *leftTableV;
|
|
|
@property (nonatomic, strong) KWSearchSubTypeTableView *rightTableV;
|
|
|
@property (nonatomic, strong) UIView *bottomV;
|
|
|
-@property (nonatomic, strong) UIButton *cusBackBt;
|
|
|
|
|
|
@end
|
|
|
|
|
@@ -24,6 +23,39 @@
|
|
|
[super viewDidLoad];
|
|
|
[self loadSubVs];
|
|
|
|
|
|
+
|
|
|
+ NSMutableArray<KWMainTypeModel *> *tempArr = [NSMutableArray array];
|
|
|
+ for (int i = 0; i<8; i++) {
|
|
|
+ [tempArr addObject:[KWMainTypeModel demoData]];
|
|
|
+ }
|
|
|
+
|
|
|
+ NSMutableArray *subArr = [[NSMutableArray alloc] init];
|
|
|
+
|
|
|
+
|
|
|
+ for (NSString *dic in @[@"AUD",@"CAD",@"EUR",@"GBP",@"USD",@"ZAR"]) {
|
|
|
+ NSString *name = dic;
|
|
|
+ NSString *short_name = dic;
|
|
|
+ NSNumber *status =[NSNumber numberWithBool:[dic isEqualToString:@"USD"]];
|
|
|
+
|
|
|
+ KWSubTypeSectionModel *m = [[KWSubTypeSectionModel alloc] init];
|
|
|
+ m.Id = short_name;
|
|
|
+ m.title = name;
|
|
|
+ m.isOpen = status.boolValue;
|
|
|
+ m.isMoneyType = true;
|
|
|
+ m.children = [[NSMutableArray alloc] init];
|
|
|
+ [subArr addObject:m];
|
|
|
+ }
|
|
|
+
|
|
|
+ KWMainTypeModel *model = [KWMainTypeModel new];
|
|
|
+ model.title = @"CURRENCY";
|
|
|
+ model.isMoneyType = true;
|
|
|
+ model.children = subArr;
|
|
|
+ [tempArr addObject:model];
|
|
|
+ _leftTableV.arr = tempArr;
|
|
|
+ _rightTableV.arr = tempArr.firstObject.children;
|
|
|
+ [_leftTableV reloadData];
|
|
|
+ [_rightTableV reloadData];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)loadSubVs {
|
|
@@ -31,13 +63,6 @@
|
|
|
self.customNavBar.backgroundColor = _E0FFF5;
|
|
|
self.titleStr = @"Category";
|
|
|
|
|
|
- [self.customNavBar addSubview:self.cusBackBt];
|
|
|
- [self.cusBackBt mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.trailing.equalTo(self.customNavBar).offset(-10);
|
|
|
- make.centerY.equalTo(self.customNavBar);
|
|
|
- make.width.height.equalTo(@44);
|
|
|
- }];
|
|
|
-
|
|
|
[self.view addSubview:self.bottomV];
|
|
|
[self.bottomV addSubview:self.leftTableV];
|
|
|
[self.bottomV addSubview:self.rightTableV];
|
|
@@ -72,15 +97,13 @@
|
|
|
[self.navigationController pushViewController:vc animated:true];
|
|
|
}
|
|
|
|
|
|
-- (void)backAction {
|
|
|
- [self dismissViewControllerAnimated:true completion:nil];
|
|
|
-}
|
|
|
|
|
|
|
|
|
// MARK: - subvs
|
|
|
- (KWSearchMainTypeTableView *)leftTableV {
|
|
|
if (!_leftTableV) {
|
|
|
KWSearchMainTypeTableView *leftTab = [[KWSearchMainTypeTableView alloc] initWithFrame:CGRectMake(0, 10, 180, self.view.bounds.size.height) style:UITableViewStylePlain];
|
|
|
+ leftTab.backgroundColor = _F8F8F8;
|
|
|
@weakify(self);
|
|
|
_leftTableV = leftTab;
|
|
|
leftTab.callBack = ^{
|
|
@@ -107,6 +130,7 @@
|
|
|
- (KWSearchSubTypeTableView *)rightTableV {
|
|
|
if(!_rightTableV) {
|
|
|
KWSearchSubTypeTableView *tab = [[KWSearchSubTypeTableView alloc] initWithFrame:CGRectMake(0, 10, 180, self.view.bounds.size.height) style:UITableViewStylePlain];
|
|
|
+ tab.backgroundColor = _F8F8F8;
|
|
|
_rightTableV = tab;
|
|
|
@weakify(self);
|
|
|
[_rightTableV setCallBack:^(NSIndexPath * _Nonnull indexP) {
|
|
@@ -139,15 +163,7 @@
|
|
|
return _rightTableV;
|
|
|
}
|
|
|
|
|
|
-- (UIButton *)cusBackBt {
|
|
|
- if (!_cusBackBt) {
|
|
|
- UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- [bt setImage:[UIImage imageNamed:@"nav_back"] forState:UIControlStateNormal];
|
|
|
- [bt addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- _cusBackBt = bt;
|
|
|
- }
|
|
|
- return _cusBackBt;
|
|
|
-}
|
|
|
+
|
|
|
|
|
|
|
|
|
-(UIView *)bottomV {
|