






#import "ShapeBayerDayViewController.h"
#import "WetToast.h"
#import "SpaRawInfo.h"

@interface ShapeBayerDayViewController ()

@property (nonatomic, strong) UIImageView *walkCloudView;
@property (nonatomic, strong) UIButton *tapMiterSixButton;
@property (nonatomic, strong) UIView *icelandicView;
@property (nonatomic, strong) UILabel *vitalRawLabel;
@property (nonatomic, strong) UITextField *mapAuxiliaryTextField;
@property (nonatomic, strong) UITextField *provisionTreeTextField;
@end

@implementation ShapeBayerDayViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.adjustSuchButton.hidden = YES;
    
    if ([SpaRawInfo decipherLaunchFunPreventedOurImage]) {
        self.walkCloudView = [[UIImageView alloc] initWithImage:[SpaRawInfo decipherLaunchFunPreventedOurImage]];
        [self.view addSubview:self.walkCloudView];
        self.walkCloudView.hidden = YES;
        [self.walkCloudView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(PrintFarFor.guideMaySelf.thickChapter);
            make.left.equalTo(self.wayEitherButton.mas_right);
            make.top.equalTo(self.view).offset(PrintFarFor.guideMaySelf.chatQuantize);
        }];
    }
    
    self.icelandicView = [PrintFarFor icelandicView];
    self.icelandicView.hidden = YES;
    [self.view addSubview:self.icelandicView];
    [self.icelandicView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([SpaRawInfo decipherLaunchFunPreventedOurImage]) {
            make.centerY.equalTo(self.walkCloudView);
            make.left.equalTo(self.walkCloudView.mas_right).offset(PrintFarFor.guideMaySelf.splatButPen);
        }else {
            make.top.equalTo(self.view).offset(PrintFarFor.guideMaySelf.chatQuantize);
            make.left.equalTo(self.wayEitherButton.mas_right).offset(PrintFarFor.guideMaySelf.splatButPen);
        }
        make.right.equalTo(self.adjustSuchButton.mas_left);
        make.height.mas_equalTo(PrintFarFor.guideMaySelf.thickChapter);
    }];
    
    self.vitalRawLabel = [PrintFarFor complexSolutionsDaysSuchKazakh:PrintFarFor.tempSockJobHas.albanianCapDescendHowExternal];
    self.vitalRawLabel.numberOfLines = 0;
    [self.view addSubview:self.vitalRawLabel];
    [self.vitalRawLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(PrintFarFor.guideMaySelf.maxStrokeWas);
        make.left.mas_equalTo(PrintFarFor.guideMaySelf.staleOddJoin);
        make.right.mas_equalTo(-PrintFarFor.guideMaySelf.staleOddJoin);
    }];
    
    
    self.mapAuxiliaryTextField = [PrintFarFor wrongCombinedMildApertureKilowattAccount];
    self.mapAuxiliaryTextField.enabled = NO;
    self.mapAuxiliaryTextField.text = self.tryGreekEnd[PrintFarFor.guideMaySelf.seeSizeHeapName];
    [self dependingTraitMapBookLinePackView:self.mapAuxiliaryTextField text:PrintFarFor.tempSockJobHas.dayRecognizeSeeChecksumBox];
    [self.view addSubview:self.mapAuxiliaryTextField];
    [self.mapAuxiliaryTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.vitalRawLabel.mas_bottom).offset(PrintFarFor.guideMaySelf.storeMutable);
        make.left.mas_equalTo(PrintFarFor.guideMaySelf.bagShotEqual);
        make.right.mas_equalTo(-PrintFarFor.guideMaySelf.bagShotEqual);
        make.height.mas_equalTo(PrintFarFor.guideMaySelf.bikeSurgeBin);
    }];
    
    
    self.provisionTreeTextField = [PrintFarFor wrongCombinedMildApertureKilowattAccount];
    self.provisionTreeTextField.enabled = NO;
    self.provisionTreeTextField.text = self.tryGreekEnd[PrintFarFor.guideMaySelf.icyWhileFitKey];
    [self dependingTraitMapBookLinePackView:self.provisionTreeTextField text:PrintFarFor.tempSockJobHas.proxiesStreetUnsignedBoldOrdinals];
    [self.view addSubview:self.provisionTreeTextField];
    [self.provisionTreeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.mapAuxiliaryTextField.mas_bottom).offset(PrintFarFor.guideMaySelf.storeMutable);
        make.left.right.equalTo(self.mapAuxiliaryTextField);
        make.height.mas_equalTo(PrintFarFor.guideMaySelf.bikeSurgeBin);
    }];
    
    
    UIButton *planarSheButton = [PrintFarFor entityBlurDogBestDisablesColor:PrintFarFor.tempSockJobHas.personalTagCanonJobObserver];
    [planarSheButton addTarget:self action:@selector(lookHandledSlovakGainSocketAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:planarSheButton];
    [planarSheButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.provisionTreeTextField.mas_bottom).offset(PrintFarFor.guideMaySelf.storeMutable);
        make.left.right.equalTo(self.provisionTreeTextField);
        make.height.mas_equalTo(PrintFarFor.guideMaySelf.thickChapter);
    }];
    
    
    self.tapMiterSixButton = [PrintFarFor unifyVortexMidRecordingFeed:PrintFarFor.tempSockJobHas.seekHueBoyfriendInactiveCountingKilobits];
    [self.tapMiterSixButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.tapMiterSixButton addTarget:self action:@selector(longTerahertzWhoPitchWakeAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.tapMiterSixButton];
    [self.tapMiterSixButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(planarSheButton.mas_bottom).offset(PrintFarFor.guideMaySelf.areAirSplit);
        make.centerX.equalTo(self.view);
    }];
}

- (void)dependingTraitMapBookLinePackView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(PrintFarFor.guideMaySelf.thickChapter, PrintFarFor.guideMaySelf.bikeSurgeBin)};
    UILabel *realRain = [[UILabel alloc] initWithFrame:frame];
    realRain.text = text;
    realRain.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = realRain;
}

- (void)longTerahertzWhoPitchWakeAction:(UIButton *)sender {
    [[WeekStripManager shared] spanOwnDayNumeratorDroppedUpsideViewController:self.navigationController];
}

- (void)lookHandledSlovakGainSocketAction:(UIButton *)sender {
    sender.hidden = YES;
    self.vitalRawLabel.hidden = YES;
    self.icelandicView.hidden = NO;
    self.walkCloudView.hidden = NO;
    self.tapMiterSixButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(PrintFarFor.guideMaySelf.digitalFinalBuffersSectionGreaterWidth, PrintFarFor.guideMaySelf.collisionEnergySpacingDownloadPortBed-PrintFarFor.guideMaySelf.boxAbovePast));
    }];
    [self.mapAuxiliaryTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.icelandicView.mas_bottom).offset(PrintFarFor.guideMaySelf.storeMutable);
    }];
    [self.view layoutIfNeeded];
    
    BOOL intro = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:PrintFarFor.guideMaySelf.bothMotionLineSigmaHerRollbackBar];
    if (!intro) {
        self.adjustSuchButton.hidden = NO;
        [NetAlertView ubiquityMildMileIntentMoreHello:nil message:PrintFarFor.tempSockJobHas.interruptInitiallySinMathOut completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= PrintFarFor.guideMaySelf.tryBannerSob;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:wrappingMenScheduledSurrogateThirdHow:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image wrappingMenScheduledSurrogateThirdHow:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[WeekStripManager shared] spanOwnDayNumeratorDroppedUpsideViewController:self.navigationController];
        [WetToast sharing:PrintFarFor.tempSockJobHas.dogRefinedTransposeSexWorkouts];
    }else {
        self.adjustSuchButton.hidden = NO;
        [NetAlertView ubiquityMildMileIntentMoreHello:nil message:PrintFarFor.tempSockJobHas.interruptInitiallySinMathOut completion:nil];
    }
}

@end
