






#import "SexSheItsHertzViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+DublinZip.h"
#import "NSString+LeapUsedNot.h"

@interface SexSheItsHertzViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *headBundleOnceControl;
@property (nonatomic, strong) UIView * napChargeDiacriticCollationError;
@property (nonatomic, strong) UIView * directionTooApplyAccuracyDay;

@property (nonatomic, strong) UIScrollView * ropePlayingView;

@end

@implementation SexSheItsHertzViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.tooSumWakeButton.hidden = YES;
    self.wayHyphenButton.hidden = YES;
    
    UISegmentedControl *sobSinkView = [[UISegmentedControl alloc] initWithItems:@[MillLiftIll.cutHoldDateSix.pointerDigitResumeUnionUnwrapKeys,MillLiftIll.cutHoldDateSix.realProcessSixteenEqualityLoudEventual]];
    sobSinkView.layer.masksToBounds = YES; 
    sobSinkView.layer.cornerRadius = 2;    
    [sobSinkView setTitleTextAttributes:@{NSForegroundColorAttributeName:[MillLiftIll shearHeadColor]} forState:UIControlStateSelected];
    [sobSinkView setTitleTextAttributes:@{NSForegroundColorAttributeName:[MillLiftIll shearHeadColor]} forState:UIControlStateNormal];
    [self.view addSubview:sobSinkView];
    [sobSinkView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(MillLiftIll.hintLegalHue.subDutchSob);
    }];
    [sobSinkView addTarget:self action:@selector(treeIdleAlpha:) forControlEvents:UIControlEventValueChanged];
    self.headBundleOnceControl = sobSinkView;
    
    _ropePlayingView = [[UIScrollView alloc]init];
    _ropePlayingView.pagingEnabled = YES;
    _ropePlayingView.delegate = self;
    [self.view addSubview:_ropePlayingView];
    [_ropePlayingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(MillLiftIll.hintLegalHue.unitLowerGet);
        make.right.equalTo(self.view).offset(-MillLiftIll.hintLegalHue.unitLowerGet);
        make.top.equalTo(self.view).offset(MillLiftIll.hintLegalHue.faxEggScheme);
        make.bottom.equalTo(self.view).offset(-MillLiftIll.hintLegalHue.atomNickname);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.ropePlayingView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.ropePlayingView);
        make.height.equalTo(_ropePlayingView);
    }];
    
    UIView * planeDarkAll = [self bestResizeView:[MillLiftIll extentsLiteralSuchCursorPhysical]];
    [containerView addSubview:planeDarkAll];
    [planeDarkAll mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.ropePlayingView);
    }];
    self.napChargeDiacriticCollationError = planeDarkAll;
    
    UIView * providersOne = [self bestResizeView:[MillLiftIll atomUnwrapAccurateFarMake]];
    [containerView addSubview:providersOne];
    [providersOne mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(planeDarkAll.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.ropePlayingView);
    }];
    self.directionTooApplyAccuracyDay = providersOne;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(providersOne.mas_right);
    }];
    
    if (![self.slashBusAsk boolValue]) {
        UIButton *convertButton = [MillLiftIll balticUnderageGetFinishedBaselineColor:MillLiftIll.cutHoldDateSix.popDecigrams];
        [convertButton setBackgroundImage:[UIImage recoveredStairColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [convertButton addTarget:self action:@selector(drumObscuresMayDueVariablesFree:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:convertButton];
        [convertButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-MillLiftIll.hintLegalHue.literRevert);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(MillLiftIll.hintLegalHue.pronounBlink);
        }];
    }
    
    UIButton *fatSinkButton =  [MillLiftIll balticUnderageGetFinishedBaselineColor:MillLiftIll.cutHoldDateSix.getEntropy];
    [fatSinkButton addTarget:self action:@selector(lowHoldSuspendedExposureNorthPreserve:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:fatSinkButton];
    [fatSinkButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-MillLiftIll.hintLegalHue.literRevert);
        make.centerX.equalTo(self.view).multipliedBy(![self.slashBusAsk boolValue]?1.35:1);
        make.height.mas_equalTo(MillLiftIll.hintLegalHue.pronounBlink);
    }];
    
    sobSinkView.selectedSegmentIndex = 0;
    [self treeIdleAlpha:sobSinkView];
}

-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
    [self.headBundleOnceControl setSelectedSegmentIndex:scrollView.contentOffset.x/self.view.frame.size.width ==0?0:1];
    [self fastestCoverageFailResponderTwistText:scrollView.contentOffset.x/self.view.frame.size.width ==0?0:1];
}

- (void)treeIdleAlpha:(UISegmentedControl *)sender {
    [self fastestCoverageFailResponderTwistText:sender.selectedSegmentIndex == 0?0:1];
    [self.ropePlayingView setContentOffset:CGPointMake(sender.selectedSegmentIndex == 0?0:self.ropePlayingView.frame.size.width, 0) animated:YES];
}

- (void)fastestCoverageFailResponderTwistText:(NSInteger)type {
    NSString *fillerLess = nil;
    UIView *contentView = nil;
    fillerLess = type == 0 ? [MillLiftIll extentsLiteralSuchCursorPhysical]:[MillLiftIll atomUnwrapAccurateFarMake];
    contentView = type == 0 ? self.napChargeDiacriticCollationError:self.directionTooApplyAccuracyDay;
    
    if (fillerLess.eulerHintOwn) {
        return;
    }
    
    if ([[fillerLess pathExtension] containsString:MillLiftIll.hintLegalHue.gesturesFatPlusPermanentVertical]) {
        UITextView *allView = (UITextView *)contentView;
        if (allView.text.length > 0) {
            return;
        }

        
        [TradFaxAgeView wetPoolButHexView:contentView];

        
        NSURL *url = [NSURL URLWithString:fillerLess];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [TradFaxAgeView illYetDecreaseManEscapedView:contentView];
                
                if (error || data.length == 0) {
                    
                    allView.text = MillLiftIll.cutHoldDateSix.songAcrossChargeLegalPartlySwimming;
                    return;
                }
                
                
                NSString *measureDerive = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                allView.text = measureDerive ?: MillLiftIll.cutHoldDateSix.panPutProjectsRadioAvailPhaseUser;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *repeat = (WKWebView *)contentView;
        if (!repeat.isLoading && repeat.estimatedProgress == 1) {
            [TradFaxAgeView illYetDecreaseManEscapedView:contentView];
            return;
        }
        [TradFaxAgeView wetPoolButHexView:contentView];
        NSString *safetyBag =  [fillerLess.gatewaysMeanGuestGenderHeadlineAmpere stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:safetyBag];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [repeat loadRequest:request];
    }
}

- (void)drumObscuresMayDueVariablesFree:(id)sender {
    [self ticketsHeightPageOldestDayAction:nil];
    if (self.searchChatAdvisoryChapterUser) {
        self.searchChatAdvisoryChapterUser(NO);
    }
}

- (void)lowHoldSuspendedExposureNorthPreserve:(id)sender {
    [self ticketsHeightPageOldestDayAction:nil];
    if (self.searchChatAdvisoryChapterUser) {
        self.searchChatAdvisoryChapterUser(YES);
    }
}

- (UIView *)bestResizeView:(NSString *)string {
    UIView *curveSheMax = nil;
    if ([[string pathExtension] containsString:MillLiftIll.hintLegalHue.gesturesFatPlusPermanentVertical]) {
        UITextView * lateExec = [UITextView new];
        lateExec.editable = NO;
        lateExec.backgroundColor = UIColor.whiteColor;
        lateExec.textColor = UIColor.grayColor;
        curveSheMax = lateExec;
    }else {
        WKWebView *menLinkHold = [[WKWebView alloc] initWithFrame:CGRectZero];
        menLinkHold.backgroundColor = UIColor.clearColor;
        menLinkHold.scrollView.backgroundColor = UIColor.lightGrayColor;
        menLinkHold.opaque = YES;
        menLinkHold.scrollView.bounces =NO;
        menLinkHold.scrollView.showsVerticalScrollIndicator = NO;
        menLinkHold.scrollView.showsHorizontalScrollIndicator = NO;
        menLinkHold.navigationDelegate = self;
        curveSheMax = menLinkHold;
    }
    return curveSheMax;
}

- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
    [TradFaxAgeView illYetDecreaseManEscapedView:webView];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    UIEdgeInsets orangeOnly = [[BitmapWaxManager shared] freezingThinWindow].safeAreaInsets;
    orangeOnly.top    += 10;
    orangeOnly.left   += 10;
    orangeOnly.bottom += 10;
    orangeOnly.right  += 10;

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

@end
