






#import "RopeGolfOwnViewController.h"
#import "SDWebImageManager.h"
#import "FitToast.h"
#import "NSString+ReturnHow.h"

@interface RopeGolfOwnViewController ()

@property (nonatomic, strong) UIImageView *illCellDoneImageView;
@property (nonatomic, strong) UITextField *dimensionTextField;
@property (nonatomic, strong) UITextField *eggPipeRuleTextField;

@end

@implementation RopeGolfOwnViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.magicPieceButton.hidden = [self.crossActive[0] boolValue];
    
    CGFloat pongPromiseBitChatClang = HisGeometry.sinkIcyLeaky.youCostSolid;
    
    UILabel *pinLabel = [HisGeometry settingSlantSymbolicStakeUnlikely:HisGeometry.illLoudEarFlow.axialUnablePostalYouRetrieve];
    pinLabel.numberOfLines = 0;
    [self.view addSubview:pinLabel];
    [pinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(HisGeometry.sinkIcyLeaky.subjectQuery);
        make.left.mas_equalTo(HisGeometry.sinkIcyLeaky.musicLookFit);
        make.right.mas_equalTo(-HisGeometry.sinkIcyLeaky.musicLookFit);
    }];
    
    
    self.dimensionTextField = [HisGeometry headElementField:HisGeometry.illLoudEarFlow.rainProducedVersionsButtonRedEighteen isSecure:NO];
    [self.view addSubview:self.dimensionTextField];
    [self.dimensionTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(pinLabel.mas_bottom).offset(pongPromiseBitChatClang);
        make.left.mas_equalTo(HisGeometry.sinkIcyLeaky.precisionUse);
        make.right.mas_equalTo(-HisGeometry.sinkIcyLeaky.precisionUse);
        make.height.mas_equalTo(HisGeometry.sinkIcyLeaky.artsPaperFat);
    }];
    
    
    self.eggPipeRuleTextField = [HisGeometry headElementField:HisGeometry.illLoudEarFlow.vitalityAdapterThePacketsSumPublic isSecure:NO];;
    [self.view addSubview:self.eggPipeRuleTextField];
    [self.eggPipeRuleTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.dimensionTextField.mas_bottom).offset(pongPromiseBitChatClang);
        make.left.right.equalTo(self.dimensionTextField);
        make.height.mas_equalTo(HisGeometry.sinkIcyLeaky.artsPaperFat);
    }];
    
    
    UIImageView *vendorImageView = nil;
    if ([self.crossActive[1] length] > 0) {
        
        vendorImageView = [[UIImageView alloc] init];
        vendorImageView.backgroundColor = UIColor.lightGrayColor;
        vendorImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:vendorImageView];
        [vendorImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.eggPipeRuleTextField.mas_bottom).offset(pongPromiseBitChatClang);
            make.width.mas_equalTo(self.eggPipeRuleTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.illCellDoneImageView = vendorImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.crossActive[1]] options:0 progress:nil completed:^(UIImage * _Nullable image2, NSData * _Nullable data, NSError * _Nullable error, SDImageCacheType cacheType, BOOL finished, NSURL * _Nullable imageURL) {
            dispatch_async(dispatch_get_main_queue(), ^{
                vendorImageView.image = image2;
                CGFloat bevel = image2.size.height / image2.size.width;
                [vendorImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((HisGeometry.sinkIcyLeaky.wordAmbientCopticPublicFocusingWidth -HisGeometry.sinkIcyLeaky.precisionUse*2)*bevel);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.illCellDoneImageView ? self.illCellDoneImageView.frame.size.height + HisGeometry.sinkIcyLeaky.youCostSolid +HisGeometry.sinkIcyLeaky.frenchProminentTheFlashWillGateways : HisGeometry.sinkIcyLeaky.frenchProminentTheFlashWillGateways;
                    
                    make.size.mas_equalTo(CGSizeMake(HisGeometry.sinkIcyLeaky.wordAmbientCopticPublicFocusingWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.illCellDoneImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.illCellDoneImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *googlePutButton = [HisGeometry momentaryQueryingTryExclusiveSamplingColor:HisGeometry.illLoudEarFlow.zeroPetabytesLemmaCompanyIodine];
    [googlePutButton addTarget:self action:@selector(modifiedOperatingEndSpaFragmentsCreate:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:googlePutButton];
    [googlePutButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-HisGeometry.sinkIcyLeaky.secretThread);
        make.left.right.equalTo(self.dimensionTextField);
        make.height.mas_equalTo(HisGeometry.sinkIcyLeaky.adjustsStamp);
    }];
    
}

- (void)modifiedOperatingEndSpaFragmentsCreate:(id)sender {
if (self.dimensionTextField.text.pubFlushNear || self.eggPipeRuleTextField.text.pubFlushNear) {
        [CatAlertView encodedSilenceUptimeWasScanningGray:HisGeometry.illLoudEarFlow.stableAdd message:HisGeometry.illLoudEarFlow.signProducesLongestPeriodCacheCurl completion:nil];
        return;
    }
    if ([self.prefixDestroy respondsToSelector:@selector(overflowRearrangeSpokenDuePurpleRecordingWithName:kitAny:completion:)]) {
        [OldestSnowView warpRawButIcyWindow];
        [self.prefixDestroy overflowRearrangeSpokenDuePurpleRecordingWithName:self.dimensionTextField.text kitAny:self.eggPipeRuleTextField.text completion:^(id object) {
            [OldestSnowView grantingOrangeStepperFitnessLatvianWindow];
            if ([object boolValue]) {
                [[FarEntityManager shared] aloneWalkingWindow];
                [FitToast menDecibel:HisGeometry.illLoudEarFlow.shutterPreviewsChainOldRenewalCollation];
            }
        }];
    }
}

@end
