






#import "BinaryShapeViewController.h"
#import "SDWebImageManager.h"
#import "CatToast.h"
#import "NSString+Redirects.h"

@interface BinaryShapeViewController ()

@property (nonatomic, strong) UIImageView *largeThreadImageView;
@property (nonatomic, strong) UITextField *areSystemTextField;
@property (nonatomic, strong) UITextField *busResponseTextField;

@end

@implementation BinaryShapeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.anyDisplayButton.hidden = [self.barsOptSpan[0] boolValue];
    
    CGFloat exceededAllAlgorithmNonceChamber = DistantEach.whoFrenchMin.napDatumUsed;
    
    UILabel *bitLabel = [DistantEach hisCancelledAnchorsSpineBehave:DistantEach.earMayTopModel.operationPrincipalHelpersReliableSon];
    bitLabel.numberOfLines = 0;
    [self.view addSubview:bitLabel];
    [bitLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(DistantEach.whoFrenchMin.eggGathering);
        make.left.mas_equalTo(DistantEach.whoFrenchMin.pipeFlexible);
        make.right.mas_equalTo(-DistantEach.whoFrenchMin.pipeFlexible);
    }];
    
    
    self.areSystemTextField = [DistantEach wakePreciseField:DistantEach.earMayTopModel.clinicalSmoothTheElectricSinhaleseCondensed isSecure:NO];
    [self.view addSubview:self.areSystemTextField];
    [self.areSystemTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(bitLabel.mas_bottom).offset(exceededAllAlgorithmNonceChamber);
        make.left.mas_equalTo(DistantEach.whoFrenchMin.topFatChrome);
        make.right.mas_equalTo(-DistantEach.whoFrenchMin.topFatChrome);
        make.height.mas_equalTo(DistantEach.whoFrenchMin.peopleHealth);
    }];
    
    
    self.busResponseTextField = [DistantEach wakePreciseField:DistantEach.earMayTopModel.itemSurrogatePasteLengthsPubSeed isSecure:NO];;
    [self.view addSubview:self.busResponseTextField];
    [self.busResponseTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.areSystemTextField.mas_bottom).offset(exceededAllAlgorithmNonceChamber);
        make.left.right.equalTo(self.areSystemTextField);
        make.height.mas_equalTo(DistantEach.whoFrenchMin.peopleHealth);
    }];
    
    
    UIImageView *theKeyImageView = nil;
    if ([self.barsOptSpan[1] length] > 0) {
        
        theKeyImageView = [[UIImageView alloc] init];
        theKeyImageView.backgroundColor = UIColor.lightGrayColor;
        theKeyImageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:theKeyImageView];
        [theKeyImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.busResponseTextField.mas_bottom).offset(exceededAllAlgorithmNonceChamber);
            make.width.mas_equalTo(self.busResponseTextField);
            make.centerX.mas_equalTo(0);
        }];
        self.largeThreadImageView = theKeyImageView;
        
        [[SDWebImageManager sharedManager] loadImageWithURL:[NSURL URLWithString:self.barsOptSpan[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(), ^{
                theKeyImageView.image = image2;
                CGFloat ratio = image2.size.height / image2.size.width;
                [theKeyImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                    make.height.mas_equalTo((DistantEach.whoFrenchMin.forkOddSmoothForkPlacementWidth -DistantEach.whoFrenchMin.topFatChrome*2)*ratio);
                }];
                [self.view layoutIfNeeded];
                
                [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
                    make.center.mas_equalTo(0);
                    CGFloat height = self.largeThreadImageView ? self.largeThreadImageView.frame.size.height + DistantEach.whoFrenchMin.napDatumUsed +DistantEach.whoFrenchMin.convertedEchoWaitProducedDropIntent : DistantEach.whoFrenchMin.convertedEchoWaitProducedDropIntent;
                    
                    make.size.mas_equalTo(CGSizeMake(DistantEach.whoFrenchMin.forkOddSmoothForkPlacementWidth, MIN(height, UIScreen.mainScreen.bounds.size.height)));
                    if (height > UIScreen.mainScreen.bounds.size.height) {
                        [self.largeThreadImageView mas_updateConstraints:^(MASConstraintMaker *make) {
                            make.height.mas_equalTo(self.largeThreadImageView.frame.size.height-(height-UIScreen.mainScreen.bounds.size.height));
                        }];
                    }
                }];
            });
        }];
    }
    
    
    UIButton *pongFinalButton = [DistantEach pongLocalExpiresEndBitColor:DistantEach.earMayTopModel.datumResonantThickComplexResume];
    [pongFinalButton addTarget:self action:@selector(immediateArgumentClockwiseMeasureInputSmooth:) forControlEvents:(UIControlEventTouchUpInside)];
    [self.view addSubview:pongFinalButton];
    [pongFinalButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-DistantEach.whoFrenchMin.azimuthStake);
        make.left.right.equalTo(self.areSystemTextField);
        make.height.mas_equalTo(DistantEach.whoFrenchMin.torchTheSolo);
    }];
    
}

- (void)immediateArgumentClockwiseMeasureInputSmooth:(id)sender {

}

@end
