






#import "StrokeInsetViewController.h"
#import "SDWebImageManager.h"
#import "ItsToast.h"
#import "NSString+EntityArm.h"

@interface StrokeInsetViewController ()

@property (nonatomic, strong) UIImageView *hasInterestImageView;
@property (nonatomic, strong) UITextField *includingTextField;
@property (nonatomic, strong) UITextField *penYearsFarTextField;

@end

@implementation StrokeInsetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.learnMightButton.hidden = [self.wasSelfIron[0] boolValue];
    
    CGFloat markDiscreteCursorOptimizedFail = ReceivedFor.dogMagicChar.nodeExistent;
    
    UILabel *pubLabel = [ReceivedFor archiveBoundaryFeetCollapsedIdentical:ReceivedFor.strokeMoveStep.pubDefaultIndicatedEmergencyPredicted];
    pubLabel.numberOfLines = 0;
    [self.view addSubview:pubLabel];
    [pubLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(ReceivedFor.dogMagicChar.cleanRunAuto);
        make.left.mas_equalTo(ReceivedFor.dogMagicChar.pintFunModel);
        make.right.mas_equalTo(-ReceivedFor.dogMagicChar.pintFunModel);
    }];
    
    
    self.includingTextField = [ReceivedFor headlineNowField:ReceivedFor.strokeMoveStep.freezingFocalPunjabiBadmintonClosestFilm isSecure:NO];
    [self.view addSubview:self.includingTextField];
    [self.includingTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(pubLabel.mas_bottom).offset(markDiscreteCursorOptimizedFail);
        make.left.mas_equalTo(ReceivedFor.dogMagicChar.reloadCreate);
        make.right.mas_equalTo(-ReceivedFor.dogMagicChar.reloadCreate);
        make.height.mas_equalTo(ReceivedFor.dogMagicChar.performerPop);
    }];
    
    
    self.penYearsFarTextField = [ReceivedFor headlineNowField:ReceivedFor.strokeMoveStep.poloRemainingDeletingTiedBarLargest isSecure:NO];;
    [self.view addSubview:self.penYearsFarTextField];
    [self.penYearsFarTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.includingTextField.mas_bottom).offset(markDiscreteCursorOptimizedFail);
        make.left.right.equalTo(self.includingTextField);
        make.height.mas_equalTo(ReceivedFor.dogMagicChar.performerPop);
    }];
    
    
    UIImageView *shrinkImageView = nil;
    if ([self.wasSelfIron[1] length] > 0) {
        
        shrinkImageView = [[UIImageView alloc] init];
        shrinkImageView.backgroundColor = UIColor.lightGrayColor;
        shrinkImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:shrinkImageView];
        [shrinkImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.penYearsFarTextField.mas_bottom).offset(markDiscreteCursorOptimizedFail);
            make.width.mas_equalTo(self.penYearsFarTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.hasInterestImageView = shrinkImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.wasSelfIron[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(), ^{
                shrinkImageView.image = image2;
                CGFloat still = image2.size.height / image2.size.width;
                [shrinkImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((ReceivedFor.dogMagicChar.doneInsertionLegalKitAttachWidth -ReceivedFor.dogMagicChar.reloadCreate*2)*still);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.hasInterestImageView ? self.hasInterestImageView.frame.size.height + ReceivedFor.dogMagicChar.nodeExistent +ReceivedFor.dogMagicChar.episodePointersSubfamilyLongestSkipUnsigned : ReceivedFor.dogMagicChar.episodePointersSubfamilyLongestSkipUnsigned;
                    
                    make.size.mas_equalTo(CGSizeMake(ReceivedFor.dogMagicChar.doneInsertionLegalKitAttachWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.hasInterestImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.hasInterestImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *anonymousButton = [ReceivedFor decrementJobTryTabStripColor:ReceivedFor.strokeMoveStep.commentsMegawattsPatternProduceEthernet];
    [anonymousButton addTarget:self action:@selector(operandModelWorkoutsMediaPartiallyWaist:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:anonymousButton];
    [anonymousButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-ReceivedFor.dogMagicChar.eggGuestSoft);
        make.left.right.equalTo(self.includingTextField);
        make.height.mas_equalTo(ReceivedFor.dogMagicChar.queueKitJump);
    }];
    
}

- (void)operandModelWorkoutsMediaPartiallyWaist:(id)sender {

}

@end
