x§Xãblob 7325 






#import "StepWhoOptViewController.h"
#import "BarJustTryConfig.h"
#import "NSObject+OwnModel.h"
#import "UIColor+WhoColor.h"
#import "WaxToast.h"

@interface StepWhoOptViewController ()<UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray<NSDictionary *> *subgroupPostalChildrenBadBike; 
@property (nonatomic, strong) NSArray<NSArray<NSString *> *> *waxTradPostTap; 
@property (nonatomic, strong) NSMutableArray<NSString *> *sectionTitles; 

@end

@implementation StepWhoOptViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    _subgroupPostalChildrenBadBike = [NSMutableArray array];
    _waxTradPostTap = @[];
    _sectionTitles = [NSMutableArray array];
    
    [self revokedWasView];
}

- (void)viewWillAppear:(BOOL)animated {
    
    UIEdgeInsets safeInsets = [[NiacinBigManager shared] bagHexStaticWindow].safeAreaInsets;
    
    safeInsets.top    += 10;
    safeInsets.left   += 10;
    safeInsets.bottom += 10;
    safeInsets.right  += 10;

    [self.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(safeInsets);
    }];
}


- (void)revokedWasView {
    _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    _tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    _tableView.dataSource = self;
    _tableView.delegate = self;
    _tableView.backgroundColor = [UIColor clearColor];
    [self.view addSubview:_tableView];
    [_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.agePreferButton.mas_bottom);
        make.left.right.bottom.equalTo(self.view);
    }];
    
    
    [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:NSStringFromClass(self.class)];
}


- (NSArray<NSString *> *)closeBringLazyDictionary:(NSDictionary *)funk {
    return [[funk allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
}

- (void)gainTopNotDueInfo:(NSDictionary *)info withTitle:(NSString *)title {
    if (!info || ![info isKindOfClass:[NSDictionary class]]) {
        return;
    }
    
    
    dispatch_async(dispatch_get_main_queue(), ^{
        @synchronized (self) {
            
            [self->_subgroupPostalChildrenBadBike addObject:[info copy]];
            NSArray *lastNowSay = [self closeBringLazyDictionary:info];
            self->_waxTradPostTap = [self->_waxTradPostTap arrayByAddingObject:lastNowSay];
            [self->_sectionTitles addObject:title];
            
            
            [self.tableView reloadData];
        }
    });
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return _subgroupPostalChildrenBadBike.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return _waxTradPostTap[section].count;
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    return _sectionTitles[section];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *exec = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(self.class) forIndexPath:indexPath];
    
    NSString *key;
    id value;
    NSInteger dryChatIndex = indexPath.section;
    key = _waxTradPostTap[dryChatIndex][indexPath.row];
    value = _subgroupPostalChildrenBadBike[dryChatIndex][key];
    BOOL previews = [value isKindOfClass:[NSDictionary class]] || [value isKindOfClass:[NSArray class]];
    exec.backgroundColor = [UIColor clearColor];
    
    
    for (UIView *alcohol in exec.contentView.subviews) {
        [alcohol removeFromSuperview];
    }
    
    
    UILabel *armLabel = [[UILabel alloc] init];
    armLabel.font = [UIFont monospacedSystemFontOfSize:14 weight:UIFontWeightMedium];
    armLabel.textColor = [UIColor darkGrayColor];
    armLabel.text = key;
    armLabel.numberOfLines = 0;
    [exec.contentView addSubview:armLabel];
    
    
    UILabel *alienLabel = [[UILabel alloc] init];
    alienLabel.font = [UIFont monospacedSystemFontOfSize:14 weight:UIFontWeightRegular];
    alienLabel.textColor = [UIColor blackColor];
    alienLabel.numberOfLines = 0;
    alienLabel.textAlignment = NSTextAlignmentRight;
    [exec.contentView addSubview:alienLabel];
    
    
    [armLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(exec.contentView).offset(HerLaunched.brownFairKin.yearEarAlien);
        make.top.equalTo(exec.contentView).offset(HerLaunched.brownFairKin.illStringAny);
        make.bottom.equalTo(exec.contentView).offset(-HerLaunched.brownFairKin.illStringAny);
        make.width.equalTo(exec.contentView.mas_width).multipliedBy(previews?HerLaunched.brownFairKin.popPinIndigo:HerLaunched.brownFairKin.welshSections);
    }];
    
    [alienLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(exec.contentView).offset(-HerLaunched.brownFairKin.yearEarAlien);
        make.top.equalTo(exec.contentView).offset(HerLaunched.brownFairKin.illStringAny);
        make.bottom.equalTo(exec.contentView).offset(-HerLaunched.brownFairKin.illStringAny);
        make.left.equalTo(armLabel.mas_right).offset(HerLaunched.brownFairKin.illStringAny);
    }];
    
    
    if (previews) {
        exec.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    } else {
        alienLabel.text = [value description];
        exec.accessoryType = UITableViewCellAccessoryNone;
    }
    
    return exec;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    id value;
    NSString *key;
    
    NSInteger dryChatIndex = indexPath.section;
    key = _waxTradPostTap[dryChatIndex][indexPath.row];
    value = _subgroupPostalChildrenBadBike[dryChatIndex][key];
    
    
    if ([value isKindOfClass:[NSDictionary class]]) {
        [self moireRangeDictionary:value withTitle:key];
    } else if ([value isKindOfClass:[NSArray class]]) {
        [self selectPintArray:value withTitle:key];
    } else {
        
        UIPasteboard *lockDogFax = [UIPasteboard generalPasteboard];
        [lockDogFax setString:[value description]];
        [WaxToast noneOdd:HerLaunched.brownFairKin.enableActivityLogicalEarConditionSelecting];
    }
}


- (void)moireRangeDictionary:(NSDictionary *)funk withTitle:(NSString *)title {
    StepWhoOptViewController *axialDue = [[StepWhoOptViewController alloc] init];
    [self.navigationController pushViewController:axialDue animated:NO];
    [axialDue gainTopNotDueInfo:funk withTitle:title];
}

- (void)selectPintArray:(NSArray *)array withTitle:(NSString *)title {
    
    NSMutableDictionary *greenDict = [NSMutableDictionary dictionary];
    for (NSInteger i = 0; i < array.count; i++) {
        greenDict[[NSString stringWithFormat:@"[%ld]", (long)i]] = array[i];
    }
    
    StepWhoOptViewController *axialDue = [[StepWhoOptViewController alloc] init];
    [self.navigationController pushViewController:axialDue animated:NO];
    [axialDue gainTopNotDueInfo:greenDict withTitle:[NSString stringWithFormat:@"%@ (Array)", title]];
}

@end
äáŸb