






#import "SoundHallCityViewController.h"
#import "BusToast.h"
#import "SinMaxInfo.h"

@interface SoundHallCityViewController ()

@property (nonatomic, strong) UIImageView *makeSceneView;
@property (nonatomic, strong) UIButton *orderCutterButton;
@property (nonatomic, strong) UIView *incorrectView;
@property (nonatomic, strong) UILabel *blurMindLabel;
@property (nonatomic, strong) UITextField *andTransientTextField;
@property (nonatomic, strong) UITextField *penBringDeltaTextField;
@end

@implementation SoundHallCityViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.smallBayerButton.hidden = YES;
    
    if ([SinMaxInfo elevatedQueryingLostCornerOneImage]) {
        self.makeSceneView = [[UIImageView alloc] initWithImage:[SinMaxInfo elevatedQueryingLostCornerOneImage]];
        [self.view addSubview:self.makeSceneView];
        self.makeSceneView.hidden = YES;
        [self.makeSceneView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(DidTodayWax.invitePencil.itsStarSlant);
            make.left.equalTo(self.romanGoalButton.mas_right);
            make.top.equalTo(self.view).offset(DidTodayWax.invitePencil.martialLeave);
        }];
    }
    
    self.incorrectView = [DidTodayWax incorrectView];
    self.incorrectView.hidden = YES;
    [self.view addSubview:self.incorrectView];
    [self.incorrectView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([SinMaxInfo elevatedQueryingLostCornerOneImage]) {
            make.centerY.equalTo(self.makeSceneView);
            make.left.equalTo(self.makeSceneView.mas_right).offset(DidTodayWax.invitePencil.ropeHelpMan);
        }else {
            make.top.equalTo(self.view).offset(DidTodayWax.invitePencil.martialLeave);
            make.left.equalTo(self.romanGoalButton.mas_right).offset(DidTodayWax.invitePencil.ropeHelpMan);
        }
        make.right.equalTo(self.smallBayerButton.mas_left);
        make.height.mas_equalTo(DidTodayWax.invitePencil.itsStarSlant);
    }];
    
    self.blurMindLabel = [DidTodayWax dutchTotalPresenceProtocolsPrincipal:DidTodayWax.fixEraSafeTaps.respondsBalanceQuitKoreanDue];
    self.blurMindLabel.numberOfLines = 0;
    [self.view addSubview:self.blurMindLabel];
    [self.blurMindLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(DidTodayWax.invitePencil.awakeFlagUse);
        make.left.mas_equalTo(DidTodayWax.invitePencil.optCutterYet);
        make.right.mas_equalTo(-DidTodayWax.invitePencil.optCutterYet);
    }];
    
    
    self.andTransientTextField = [DidTodayWax eyeSpaOutSaySkinAccount];
    self.andTransientTextField.enabled = NO;
    self.andTransientTextField.text = self.treeStretch[DidTodayWax.invitePencil.verticalButName];
    [self resetUsageIntroPutPercentSmoothedView:self.andTransientTextField text:DidTodayWax.fixEraSafeTaps.localizesJoinBroadcastWorkoutArchive];
    [self.view addSubview:self.andTransientTextField];
    [self.andTransientTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.blurMindLabel.mas_bottom).offset(DidTodayWax.invitePencil.kernelAscent);
        make.left.mas_equalTo(DidTodayWax.invitePencil.tabPrimeText);
        make.right.mas_equalTo(-DidTodayWax.invitePencil.tabPrimeText);
        make.height.mas_equalTo(DidTodayWax.invitePencil.gravitySwipe);
    }];
    
    
    self.penBringDeltaTextField = [DidTodayWax eyeSpaOutSaySkinAccount];
    self.penBringDeltaTextField.enabled = NO;
    self.penBringDeltaTextField.text = self.treeStretch[DidTodayWax.invitePencil.ticketsTypeKey];
    [self resetUsageIntroPutPercentSmoothedView:self.penBringDeltaTextField text:DidTodayWax.fixEraSafeTaps.sobAccuracyAllThousandSex];
    [self.view addSubview:self.penBringDeltaTextField];
    [self.penBringDeltaTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.andTransientTextField.mas_bottom).offset(DidTodayWax.invitePencil.kernelAscent);
        make.left.right.equalTo(self.andTransientTextField);
        make.height.mas_equalTo(DidTodayWax.invitePencil.gravitySwipe);
    }];
    
    
    UIButton *badmintonButton = [DidTodayWax rejectShiftInvitedObserverRectifiedColor:DidTodayWax.fixEraSafeTaps.copperPluralCanResumedGenerates];
    [badmintonButton addTarget:self action:@selector(collisionBlendHaveKitDueAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:badmintonButton];
    [badmintonButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.penBringDeltaTextField.mas_bottom).offset(DidTodayWax.invitePencil.kernelAscent);
        make.left.right.equalTo(self.penBringDeltaTextField);
        make.height.mas_equalTo(DidTodayWax.invitePencil.itsStarSlant);
    }];
    
    
    self.orderCutterButton = [DidTodayWax hyphenRetainedDesignSerializeTower:DidTodayWax.fixEraSafeTaps.spaceImperialSpaDustScatteredExpects];
    [self.orderCutterButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.orderCutterButton addTarget:self action:@selector(flightSodiumEdgaEditLoopsAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.orderCutterButton];
    [self.orderCutterButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(badmintonButton.mas_bottom).offset(DidTodayWax.invitePencil.playbackDog);
        make.centerX.equalTo(self.view);
    }];
}

- (void)resetUsageIntroPutPercentSmoothedView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(DidTodayWax.invitePencil.itsStarSlant, DidTodayWax.invitePencil.gravitySwipe)};
    UILabel *symbolic = [[UILabel alloc] initWithFrame:frame];
    symbolic.text = text;
    symbolic.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = symbolic;
}

- (void)flightSodiumEdgaEditLoopsAction:(UIButton *)sender {
    [[SexualSobManager shared] putOwnRecordingInsteadCertRadiansViewController:self.navigationController];
}

- (void)collisionBlendHaveKitDueAction:(UIButton *)sender {
    sender.hidden = YES;
    self.blurMindLabel.hidden = YES;
    self.incorrectView.hidden = NO;
    self.makeSceneView.hidden = NO;
    self.orderCutterButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(DidTodayWax.invitePencil.processesDividingBoxLookupPopoverWidth, DidTodayWax.invitePencil.fragmentsSpotlightArtSlashOptRoot-DidTodayWax.invitePencil.pictureElder));
    }];
    [self.andTransientTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.incorrectView.mas_bottom).offset(DidTodayWax.invitePencil.kernelAscent);
    }];
    [self.view layoutIfNeeded];
    
    BOOL daily = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:DidTodayWax.invitePencil.densityKazakhYoungerFarWrapPlaceOut];
    if (!daily) {
        self.smallBayerButton.hidden = NO;
        [CanAlertView maleFitRemoveAscendedStylisticDownload:nil message:DidTodayWax.fixEraSafeTaps.toneWatchHeadsetSwitchPhysical completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= DidTodayWax.invitePencil.farsiSunHash;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:failingMileSecondaryFollowerMinimumFor:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image failingMileSecondaryFollowerMinimumFor:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[SexualSobManager shared] putOwnRecordingInsteadCertRadiansViewController:self.navigationController];
        [BusToast optArea:DidTodayWax.fixEraSafeTaps.reversingGraySymbolLocalesExtension];
    }else {
        self.smallBayerButton.hidden = NO;
        [CanAlertView maleFitRemoveAscendedStylisticDownload:nil message:DidTodayWax.fixEraSafeTaps.toneWatchHeadsetSwitchPhysical completion:nil];
    }
}

@end
