






#import "MagnitudeLinkViewController.h"
#import "PutToast.h"
#import "CopperInfo.h"

@interface MagnitudeLinkViewController ()

@property (nonatomic, strong) UIImageView *itemDailyView;
@property (nonatomic, strong) UIButton *parserQuickButton;
@property (nonatomic, strong) UIView *normalCatView;
@property (nonatomic, strong) UILabel *traveledLabel;
@property (nonatomic, strong) UITextField *wetMediaFadeTextField;
@property (nonatomic, strong) UITextField *inactiveNonceTextField;
@end

@implementation MagnitudeLinkViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.ringRemoveButton.hidden = YES;
    
    if ([CopperInfo encryptBandPrematureQueryFamilyImage]) {
        self.itemDailyView = [[UIImageView alloc] initWithImage:[CopperInfo encryptBandPrematureQueryFamilyImage]];
        [self.view addSubview:self.itemDailyView];
        self.itemDailyView.hidden = YES;
        [self.itemDailyView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.mas_equalTo(CityPublish.halfInferCan.hiddenPlural);
            make.left.equalTo(self.cellTraitButton.mas_right);
            make.top.equalTo(self.view).offset(CityPublish.halfInferCan.minSynthetic);
        }];
    }
    
    self.normalCatView = [CityPublish normalCatView];
    self.normalCatView.hidden = YES;
    [self.view addSubview:self.normalCatView];
    [self.normalCatView mas_makeConstraints:^(MASConstraintMaker *make) {
        if ([CopperInfo encryptBandPrematureQueryFamilyImage]) {
            make.centerY.equalTo(self.itemDailyView);
            make.left.equalTo(self.itemDailyView.mas_right).offset(CityPublish.halfInferCan.tightDueAdd);
        }else {
            make.top.equalTo(self.view).offset(CityPublish.halfInferCan.minSynthetic);
            make.left.equalTo(self.cellTraitButton.mas_right).offset(CityPublish.halfInferCan.tightDueAdd);
        }
        make.right.equalTo(self.ringRemoveButton.mas_left);
        make.height.mas_equalTo(CityPublish.halfInferCan.hiddenPlural);
    }];
    
    self.traveledLabel = [CityPublish shortcutsFigureCanadianSpouseTamil:CityPublish.throughHosting.ourHallProtocolPressureAlarm];
    self.traveledLabel.numberOfLines = 0;
    [self.view addSubview:self.traveledLabel];
    [self.traveledLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(CityPublish.halfInferCan.netCopperTap);
        make.left.mas_equalTo(CityPublish.halfInferCan.bitsRawPolar);
        make.right.mas_equalTo(-CityPublish.halfInferCan.bitsRawPolar);
    }];
    
    
    self.wetMediaFadeTextField = [CityPublish fairExpandingDustIntentBlackAccount];
    self.wetMediaFadeTextField.enabled = NO;
    self.wetMediaFadeTextField.text = self.arrowSunSex[CityPublish.halfInferCan.pathCanWeekName];
    [self resultForwardsRegistryLicenseMarkupKilohertzView:self.wetMediaFadeTextField text:CityPublish.throughHosting.ethernetForceLastEitherRemote];
    [self.view addSubview:self.wetMediaFadeTextField];
    [self.wetMediaFadeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.traveledLabel.mas_bottom).offset(CityPublish.halfInferCan.aloneCreator);
        make.left.mas_equalTo(CityPublish.halfInferCan.shortRearTen);
        make.right.mas_equalTo(-CityPublish.halfInferCan.shortRearTen);
        make.height.mas_equalTo(CityPublish.halfInferCan.instancesAre);
    }];
    
    
    self.inactiveNonceTextField = [CityPublish fairExpandingDustIntentBlackAccount];
    self.inactiveNonceTextField.enabled = NO;
    self.inactiveNonceTextField.text = self.arrowSunSex[CityPublish.halfInferCan.tryYetTorchKey];
    [self resultForwardsRegistryLicenseMarkupKilohertzView:self.inactiveNonceTextField text:CityPublish.throughHosting.justifiedEnteredExtentCopticWin];
    [self.view addSubview:self.inactiveNonceTextField];
    [self.inactiveNonceTextField mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.wetMediaFadeTextField.mas_bottom).offset(CityPublish.halfInferCan.aloneCreator);
        make.left.right.equalTo(self.wetMediaFadeTextField);
        make.height.mas_equalTo(CityPublish.halfInferCan.instancesAre);
    }];
    
    
    UIButton *prominentButton = [CityPublish segmentGeometricTripleOldestZoomColor:CityPublish.throughHosting.inferResponseSettingsSmallMax];
    [prominentButton addTarget:self action:@selector(qualityHerLowRateFrontAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:prominentButton];
    [prominentButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.inactiveNonceTextField.mas_bottom).offset(CityPublish.halfInferCan.aloneCreator);
        make.left.right.equalTo(self.inactiveNonceTextField);
        make.height.mas_equalTo(CityPublish.halfInferCan.hiddenPlural);
    }];
    
    
    self.parserQuickButton = [CityPublish movementLifetimeAnonymousWasInvited:CityPublish.throughHosting.pickerNauticalEntitledRestoredMostlyHandling];
    [self.parserQuickButton setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
    [self.parserQuickButton addTarget:self action:@selector(audiogramDestroySpectralCombiningExtendingAction:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:self.parserQuickButton];
    [self.parserQuickButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(prominentButton.mas_bottom).offset(CityPublish.halfInferCan.grayJumpRow);
        make.centerX.equalTo(self.view);
    }];
}

- (void)resultForwardsRegistryLicenseMarkupKilohertzView:(UITextField *)textField text:(NSString *)text
{
    CGRect frame = {{0,0},CGSizeMake(CityPublish.halfInferCan.hiddenPlural, CityPublish.halfInferCan.instancesAre)};
    UILabel *allWhite = [[UILabel alloc] initWithFrame:frame];
    allWhite.text = text;
    allWhite.textColor = UIColor.redColor;
    textField.leftViewMode = UITextFieldViewModeAlways;
    textField.leftView = allWhite;
}

- (void)audiogramDestroySpectralCombiningExtendingAction:(UIButton *)sender {
    [[MapUnwindManager shared] darkSalientRetainCyrillicTrialPressViewController:self.navigationController];
}

- (void)qualityHerLowRateFrontAction:(UIButton *)sender {
    sender.hidden = YES;
    self.traveledLabel.hidden = YES;
    self.normalCatView.hidden = NO;
    self.itemDailyView.hidden = NO;
    self.parserQuickButton.hidden = YES;
    
    [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo(CGSizeMake(CityPublish.halfInferCan.applyingChatterGatherDebuggingQuoteWidth, CityPublish.halfInferCan.cutterOverSlabAndConvertRow-CityPublish.halfInferCan.standardDeny));
    }];
    [self.wetMediaFadeTextField mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.normalCatView.mas_bottom).offset(CityPublish.halfInferCan.aloneCreator);
    }];
    [self.view layoutIfNeeded];
    
    BOOL heart = [[[[NSBundle mainBundle] infoDictionary] allKeys] containsObject:CityPublish.halfInferCan.blockMalayalamAdoptScoreRareOnePhone];
    if (!heart) {
        self.ringRemoveButton.hidden = NO;
        [KeyAlertView dropProduceChineseEraInvertedTruncated:nil message:CityPublish.throughHosting.longerMostSevenZipScroll completion:nil];
        return;
    }
    CGSize size = self.view.frame.size;
    size.height -= CityPublish.halfInferCan.helpSawSolid;
    UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:embeddedWonCadenceImpliedFairCosmic:contextInfo:), (__bridge void *)self);
}

- (void)image:(UIImage *)image embeddedWonCadenceImpliedFairCosmic:(NSError *)error contextInfo:(void *)contextInfo
{
    
    if(!error){
        [[MapUnwindManager shared] darkSalientRetainCyrillicTrialPressViewController:self.navigationController];
        [PutToast bankKit:CityPublish.throughHosting.advancedSubTeamRedoToken];
    }else {
        self.ringRemoveButton.hidden = NO;
        [KeyAlertView dropProduceChineseEraInvertedTruncated:nil message:CityPublish.throughHosting.longerMostSevenZipScroll completion:nil];
    }
}

@end
