






#import "SharingCombineViewController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WKFoundation.h>
#import "NSString+MayRename.h"
#import "NSString+SpeakerMole.h"

@interface SharingCombineViewController ()<UIScrollViewDelegate,WKNavigationDelegate>

@property (nonatomic, strong) UISegmentedControl *sexSideCubeDryControl;
@property (nonatomic, strong) UIView * putItsOptimizeUniformOdd;
@property (nonatomic, strong) UIView * idleCroppingRoomSobDetail;

@property (nonatomic, strong) UIScrollView * refusedBlueView;

@end

@implementation SharingCombineViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.drawingMidButton.hidden = YES;
    self.modelBoldButton.hidden = YES;
    
    UISegmentedControl *subMaskView = [[UISegmentedControl alloc] initWithItems:@[SafeTradEar.bankRowTapsAsk.carriageUrgentQuarterRectangleAnnotatedBound,SafeTradEar.bankRowTapsAsk.invokePaletteResponderElementRoleMild]];
    subMaskView.layer.masksToBounds = YES; 
    subMaskView.layer.cornerRadius = 2;    
    [subMaskView setTitleTextAttributes:@{NSForegroundColorAttributeName:[SafeTradEar dueScreenColor]} forState:UIControlStateSelected];
    [subMaskView setTitleTextAttributes:@{NSForegroundColorAttributeName:[SafeTradEar dueScreenColor]} forState:UIControlStateNormal];
    [self.view addSubview:subMaskView];
    [subMaskView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view);
        make.top.mas_equalTo(SafeTradEar.smallestMany.withResumed);
    }];
    [subMaskView addTarget:self action:@selector(moireSlopeAge:) forControlEvents:UIControlEventValueChanged];
    self.sexSideCubeDryControl = subMaskView;
    
    _refusedBlueView = [[UIScrollView alloc]init];
    _refusedBlueView.pagingEnabled = YES;
    _refusedBlueView.delegate = self;
    [self.view addSubview:_refusedBlueView];
    [_refusedBlueView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view).offset(SafeTradEar.smallestMany.chunkFeature);
        make.right.equalTo(self.view).offset(-SafeTradEar.smallestMany.chunkFeature);
        make.top.equalTo(self.view).offset(SafeTradEar.smallestMany.fiberViewLaw);
        make.bottom.equalTo(self.view).offset(-SafeTradEar.smallestMany.sunBeginMany);
    }];
    
    UIView *containerView = [UIView new];
    containerView.backgroundColor = UIColor.whiteColor;
    [self.refusedBlueView addSubview:containerView];
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.refusedBlueView);
        make.height.equalTo(_refusedBlueView);
    }];
    
    UIView * kitPointFlag = [self forCursorsView:[SafeTradEar husbandStickyAccessedTildeMen]];
    [containerView addSubview:kitPointFlag];
    [kitPointFlag mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.bottom.equalTo(containerView);
        make.width.mas_equalTo(self.refusedBlueView);
    }];
    self.putItsOptimizeUniformOdd = kitPointFlag;
    
    UIView * sectionsFlag = [self forCursorsView:[SafeTradEar bedEnsureGatewaysLowercaseAnchors]];
    [containerView addSubview:sectionsFlag];
    [sectionsFlag mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(kitPointFlag.mas_right);
        make.bottom.top.equalTo(containerView);
        make.width.mas_equalTo(self.refusedBlueView);
    }];
    self.idleCroppingRoomSobDetail = sectionsFlag;
    
    [containerView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(sectionsFlag.mas_right);
    }];
    
    if (![self.cupDropHour boolValue]) {
        UIButton *zeroDryButton = [SafeTradEar endRedImageAccessingGrandauntColor:SafeTradEar.bankRowTapsAsk.bandWonTheme];
        [zeroDryButton setBackgroundImage:[UIImage gestureSixteenColor:[[UIColor lightGrayColor] colorWithAlphaComponent:0.5f]] forState:UIControlStateNormal];
        [zeroDryButton addTarget:self action:@selector(gaspDismissalLogicalAccurateSizeHer:) forControlEvents:(UIControlEventTouchUpInside)];
        [self.view addSubview:zeroDryButton];
        [zeroDryButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.view).offset(-SafeTradEar.smallestMany.pongPongNap);
            make.centerX.equalTo(self.view).multipliedBy(.65);
            make.height.mas_equalTo(SafeTradEar.smallestMany.tenSonStream);
        }];
    }
    
    UIButton *hisModeButton =  [SafeTradEar endRedImageAccessingGrandauntColor:SafeTradEar.bankRowTapsAsk.bringLight];
    [hisModeButton addTarget:self action:@selector(itsMountedGreekInstancesZoneVariable:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:hisModeButton];
    [hisModeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.view).offset(-SafeTradEar.smallestMany.pongPongNap);
        make.centerX.equalTo(self.view).multipliedBy(![self.cupDropHour boolValue]?1.35:1);
        make.height.mas_equalTo(SafeTradEar.smallestMany.tenSonStream);
    }];
    
    subMaskView.selectedSegmentIndex = 0;
    [self moireSlopeAge:subMaskView];
}

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

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

- (void)indentLenientJustNotDegreesText:(NSInteger)type {
    NSString *bundleCert = nil;
    UIView *contentView = nil;
    bundleCert = type == 0 ? [SafeTradEar husbandStickyAccessedTildeMen]:[SafeTradEar bedEnsureGatewaysLowercaseAnchors];
    contentView = type == 0 ? self.putItsOptimizeUniformOdd:self.idleCroppingRoomSobDetail;
    
    if (bundleCert.followHelper) {
        return;
    }
    
    if ([[bundleCert pathExtension] containsString:SafeTradEar.smallestMany.weightMirroredGoalExpandedLoading]) {
        UITextView *nowView = (UITextView *)contentView;
        if (nowView.text.length > 0) {
            return;
        }

        
        [OfferAngleView menLeaveYearsView:contentView];

        
        NSURL *url = [NSURL URLWithString:bundleCert];
        NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithURL:url
                                                                 completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
            
            dispatch_async(dispatch_get_main_queue(), ^{
                
                [OfferAngleView impactJabberInvisibleResizingBasalView:contentView];
                
                if (error || data.length == 0) {
                    
                    nowView.text = SafeTradEar.bankRowTapsAsk.stoneDidAttributeLockingCategoryMood;
                    return;
                }
                
                
                NSString *illAskFitness = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
                nowView.text = illAskFitness ?: SafeTradEar.bankRowTapsAsk.artCheckingAppearingYouOceanFisheyeStrip;
            });
        }];
        
        [task resume];

    }else {
        WKWebView *slovak = (WKWebView *)contentView;
        if (!slovak.isLoading && slovak.estimatedProgress == 1) {
            [OfferAngleView impactJabberInvisibleResizingBasalView:contentView];
            return;
        }
        [OfferAngleView menLeaveYearsView:contentView];
        NSString *waitSlash =  [bundleCert.sphereAnyArmourSoftKinYiddish stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
        NSURL *url = [NSURL URLWithString:waitSlash];
        NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:15.0];
        [slovak loadRequest:request];
    }
}

- (void)gaspDismissalLogicalAccurateSizeHer:(id)sender {
    [self manRoleEarDogSymbolicAction:nil];
    if (self.fastLingerRunSymbolBalance) {
        self.fastLingerRunSymbolBalance(NO);
    }
}

- (void)itsMountedGreekInstancesZoneVariable:(id)sender {
    [self manRoleEarDogSymbolicAction:nil];
    if (self.fastLingerRunSymbolBalance) {
        self.fastLingerRunSymbolBalance(YES);
    }
}

- (UIView *)forCursorsView:(NSString *)string {
    UIView *gramFireBar = nil;
    if ([[string pathExtension] containsString:SafeTradEar.smallestMany.weightMirroredGoalExpandedLoading]) {
        UITextView * cubeSign = [UITextView new];
        cubeSign.editable = NO;
        cubeSign.backgroundColor = UIColor.whiteColor;
        cubeSign.textColor = UIColor.grayColor;
        gramFireBar = cubeSign;
    }else {
        WKWebView *envelopeSay = [[WKWebView alloc] initWithFrame:CGRectZero];
        envelopeSay.backgroundColor = UIColor.clearColor;
        envelopeSay.scrollView.backgroundColor = UIColor.lightGrayColor;
        envelopeSay.opaque = YES;
        envelopeSay.scrollView.bounces =NO;
        envelopeSay.scrollView.showsVerticalScrollIndicator = NO;
        envelopeSay.scrollView.showsHorizontalScrollIndicator = NO;
        envelopeSay.navigationDelegate = self;
        gramFireBar = envelopeSay;
    }
    return gramFireBar;
}

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

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

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

@end
