






#import "ColumnsRegularSuchPairAliveQuarterViewController.h"
#import "FixChunkBad.h"

@interface ColumnsRegularSuchPairAliveQuarterViewController () <UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate>
@property (nonatomic, strong) UITableView *ruleWidgetView;
@property (nonatomic, strong) UISearchBar *andHintBusyBar;
@property (nonatomic, strong) NSArray<RadixHover *> *tibetanNordicMaleRenewalHow;     
@property (nonatomic, strong) NSArray<RadixHover *> *cleanAlongsidePostcardVerboseChinaFlatness; 
@end

@implementation ColumnsRegularSuchPairAliveQuarterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self hardRotorLibrariesProducerTapData];
    [self corruptSpaCampaignMagicAdvanced];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super touchesBegan:touches withEvent:event];
    [self.view endEditing:YES];
}



- (void)hardRotorLibrariesProducerTapData {
    NSArray *chunkyDid = [FlexibleAnyDryScalingAdd estonianCanBuiltSpaceHis:[RadixHover class]];
    
    
    self.tibetanNordicMaleRenewalHow = [chunkyDid sortedArrayUsingComparator:^NSComparisonResult(RadixHover *c1, RadixHover *c2) {
        return [c1.howCancel compare:c2.howCancel options:NSCaseInsensitiveSearch];
    }];
    
    self.cleanAlongsidePostcardVerboseChinaFlatness = self.tibetanNordicMaleRenewalHow;
    
    
    NSString *stylizeFocusedCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
    
    
    __block RadixHover *figureItemGain = nil;
    __block NSUInteger offRollIndex = NSNotFound;
    [self.tibetanNordicMaleRenewalHow enumerateObjectsUsingBlock:^(RadixHover *country, NSUInteger idx, BOOL *stop) {
        if ([country.fatSubtitlesCode caseInsensitiveCompare:stylizeFocusedCode] == NSOrderedSame) {
            figureItemGain = country;
            offRollIndex = idx;
            *stop = YES; 
        }
    }];
    
    
    if (figureItemGain) {
        
        
        
        NSMutableArray *beforeCountParentalSpaceTruncates = [self.tibetanNordicMaleRenewalHow mutableCopy];
        [beforeCountParentalSpaceTruncates removeObjectAtIndex:offRollIndex];    
        [beforeCountParentalSpaceTruncates insertObject:figureItemGain atIndex:0]; 
        
        
        self.tibetanNordicMaleRenewalHow = [beforeCountParentalSpaceTruncates copy];
        self.cleanAlongsidePostcardVerboseChinaFlatness = self.tibetanNordicMaleRenewalHow; 
    }
}



- (void)corruptSpaCampaignMagicAdvanced {
    self.view.clipsToBounds = YES;
    
    
    self.andHintBusyBar = [[UISearchBar alloc] init];
    self.andHintBusyBar.delegate = self;
    self.andHintBusyBar.placeholder = FixChunkBad.passLazyUnique.closestAssistantGatherDownloadsScrollsCurrentlyIll;
    self.andHintBusyBar.translatesAutoresizingMaskIntoConstraints = NO;
    [self.view addSubview:self.andHintBusyBar];
    
    
    self.ruleWidgetView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
    self.ruleWidgetView.delegate = self;
    self.ruleWidgetView.dataSource = self;
    self.ruleWidgetView.translatesAutoresizingMaskIntoConstraints = NO;
    [self.view addSubview:self.ruleWidgetView];
    
    
    UILayoutGuide *speak = self.view.safeAreaLayoutGuide;
    UILayoutGuide *optNot = self.anyOpaqueButton.safeAreaLayoutGuide;
    UILayoutGuide *tryTop = self.carIcyMaleButton.safeAreaLayoutGuide;
    [NSLayoutConstraint activateConstraints:@[
        [self.andHintBusyBar.topAnchor constraintEqualToAnchor:speak.topAnchor],
        [self.andHintBusyBar.leadingAnchor constraintEqualToAnchor:optNot.trailingAnchor],
        [self.andHintBusyBar.trailingAnchor constraintEqualToAnchor:tryTop.leadingAnchor],
        
        [self.ruleWidgetView.topAnchor constraintEqualToAnchor:self.andHintBusyBar.bottomAnchor],
        [self.ruleWidgetView.leadingAnchor constraintEqualToAnchor:speak.leadingAnchor],
        [self.ruleWidgetView.trailingAnchor constraintEqualToAnchor:speak.trailingAnchor],
        [self.ruleWidgetView.bottomAnchor constraintEqualToAnchor:speak.bottomAnchor]
    ]];
}

- (void)roleRearPutAction {
    [self dismissViewControllerAnimated:YES completion:nil];
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.cleanAlongsidePostcardVerboseChinaFlatness.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *bike = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(self.class)];
    if (!bike) {
        bike = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass(self.class)];
    }
    RadixHover *country = self.cleanAlongsidePostcardVerboseChinaFlatness[indexPath.row];
    bike.textLabel.text = [NSString stringWithFormat:@"%@ %@", [self criteriaServicesRespondGaspRatingsMeanCode:country.fatSubtitlesCode],country.howCancel];
    bike.detailTextLabel.text = [NSString stringWithFormat:@"%@ %@",FixChunkBad.swedishTwist.kitManToolMid,country.whiteMoodCode];
    return bike;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    RadixHover *wireFiveSecondHelperRemainder = self.cleanAlongsidePostcardVerboseChinaFlatness[indexPath.row];
    if ([self.calculateDelegate respondsToSelector:@selector(composerNameStateUnwindingLaotianWeeklyPopDividing:)]) {
        [self.calculateDelegate composerNameStateUnwindingLaotianWeeklyPopDividing:wireFiveSecondHelperRemainder];
    }
    [self floatingAnchoredFlatnessFaxPronounAction:nil];
}


- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
    if (searchText.length == 0) {
        self.cleanAlongsidePostcardVerboseChinaFlatness = self.tibetanNordicMaleRenewalHow;
    } else {
        NSPredicate *predicate = [NSPredicate predicateWithBlock:^BOOL(RadixHover *evaluatedObject, NSDictionary *bindings) {
            BOOL sob = [evaluatedObject.howCancel rangeOfString:searchText options:NSCaseInsensitiveSearch].location != NSNotFound;
            BOOL way = [evaluatedObject.whiteMoodCode rangeOfString:searchText options:NSCaseInsensitiveSearch].location != NSNotFound;
            return sob || way;
        }];
        self.cleanAlongsidePostcardVerboseChinaFlatness = [self.tibetanNordicMaleRenewalHow filteredArrayUsingPredicate:predicate];
    }
    [self.ruleWidgetView reloadData];
}
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
    [self.view endEditing:YES];
}

- (NSString *)criteriaServicesRespondGaspRatingsMeanCode:(NSString *)countryCode {
    
    if(![countryCode isKindOfClass:[NSString class]] || countryCode.length != 2 || [countryCode isEqualToString:@"TW"]) return @"";
    int base = 127397;
    
    wchar_t bytes[2] = {
        base +[countryCode characterAtIndex:0],
        base +[countryCode characterAtIndex:1]
    };
    
    return [[NSString alloc] initWithBytes:bytes
                                    length:countryCode.length *sizeof(wchar_t)
                                  encoding:NSUTF32LittleEndianStringEncoding];
}

- (void)dealloc {
    
}
@end
