






#import "RankSinkNapViewController.h"
#import "SDWebImageManager.h"
#import "KitToast.h"
#import "NSString+EvictFile.h"

@interface RankSinkNapViewController ()

@property (nonatomic, strong) UIImageView *openPairOddImageView;
@property (nonatomic, strong) UITextField *golfMixerTextField;
@property (nonatomic, strong) UITextField *saturateZipTextField;

@end

@implementation RankSinkNapViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.acrossStopButton.hidden = [self.runServices[0] boolValue];
    
    CGFloat flattenCombinedSectionsRestingLayout = OutTapPlain.parentMixMay.hasWasHigher;
    
    UILabel *sonLabel = [OutTapPlain chromePanFloatingDisorderFold:OutTapPlain.loudMeterMount.illegalDistinctSheFinderLove];
    sonLabel.numberOfLines = 0;
    [self.view addSubview:sonLabel];
    [sonLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(OutTapPlain.parentMixMay.tipOptAscent);
        make.left.mas_equalTo(OutTapPlain.parentMixMay.sandboxTamil);
        make.right.mas_equalTo(-OutTapPlain.parentMixMay.sandboxTamil);
    }];
    
    
    self.golfMixerTextField = [OutTapPlain sumVideoAskField:OutTapPlain.loudMeterMount.creatorExecutingFoggySegmentFitnessAnd isSecure:NO];
    [self.view addSubview:self.golfMixerTextField];
    [self.golfMixerTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(sonLabel.mas_bottom).offset(flattenCombinedSectionsRestingLayout);
        make.left.mas_equalTo(OutTapPlain.parentMixMay.takeWhiteArm);
        make.right.mas_equalTo(-OutTapPlain.parentMixMay.takeWhiteArm);
        make.height.mas_equalTo(OutTapPlain.parentMixMay.thirteenHigh);
    }];
    
    
    self.saturateZipTextField = [OutTapPlain sumVideoAskField:OutTapPlain.loudMeterMount.fillerUsesMiddleLowercaseLookContent isSecure:NO];;
    [self.view addSubview:self.saturateZipTextField];
    [self.saturateZipTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.golfMixerTextField.mas_bottom).offset(flattenCombinedSectionsRestingLayout);
        make.left.right.equalTo(self.golfMixerTextField);
        make.height.mas_equalTo(OutTapPlain.parentMixMay.thirteenHigh);
    }];
    
    
    UIImageView *oldBagImageView = nil;
    if ([self.runServices[1] length] > 0) {
        
        oldBagImageView = [[UIImageView alloc] init];
        oldBagImageView.backgroundColor = UIColor.lightGrayColor;
        oldBagImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:oldBagImageView];
        [oldBagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.saturateZipTextField.mas_bottom).offset(flattenCombinedSectionsRestingLayout);
            make.width.mas_equalTo(self.saturateZipTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.openPairOddImageView = oldBagImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.runServices[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(), ^{
                oldBagImageView.image = image2;
                CGFloat setup = image2.size.height / image2.size.width;
                [oldBagImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((OutTapPlain.parentMixMay.spotlightKelvinCapturingAskTopWidth -OutTapPlain.parentMixMay.takeWhiteArm*2)*setup);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.openPairOddImageView ? self.openPairOddImageView.frame.size.height + OutTapPlain.parentMixMay.hasWasHigher +OutTapPlain.parentMixMay.afterBadDocumentsHeightItsRectified : OutTapPlain.parentMixMay.afterBadDocumentsHeightItsRectified;
                    
                    make.size.mas_equalTo(CGSizeMake(OutTapPlain.parentMixMay.spotlightKelvinCapturingAskTopWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.openPairOddImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.openPairOddImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *learnKeysButton = [OutTapPlain busIndoorTableDrizzleAwayColor:OutTapPlain.loudMeterMount.quickEncodingsLostReuseAverage];
    [learnKeysButton addTarget:self action:@selector(duplexAddressesSlabStationThemeAuto:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:learnKeysButton];
    [learnKeysButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-OutTapPlain.parentMixMay.hisHeavyFair);
        make.left.right.equalTo(self.golfMixerTextField);
        make.height.mas_equalTo(OutTapPlain.parentMixMay.tooTabMetric);
    }];
    
}

- (void)duplexAddressesSlabStationThemeAuto:(id)sender {

}

@end
