






#import "MidLateViewController.h"
#import "UIImageView+WebCache.h"

@interface MidLateViewController ()

@end

@implementation MidLateViewController

- (UIButton *)eggSignerButton
{
    if (!_eggSignerButton) {
        _eggSignerButton = [[UIButton alloc] init];
        [_eggSignerButton setTitle:BinFaxEight.icyAboutDrum.diagnoseTildeGreatMidPairKey forState:UIControlStateNormal];
        [_eggSignerButton setTitleColor:[BinFaxEight squareBarColor] forState:UIControlStateNormal];
        [_eggSignerButton addTarget:self action:@selector(telephotoImperialSubgroupsShortcutsArtsAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _eggSignerButton;
}

- (UIButton *)coverStandButton
{
    if (!_coverStandButton) {
        _coverStandButton = [[UIButton alloc] init];
        [_coverStandButton setTitle:BinFaxEight.icyAboutDrum.ampereWonLibrariesIndexesFlippedWin forState:UIControlStateNormal];
        [_coverStandButton setTitleColor:[BinFaxEight squareBarColor] forState:UIControlStateNormal];
        [_coverStandButton addTarget:self action:@selector(askDecryptRetForBackupAction:) forControlEvents:UIControlEventTouchUpInside];
        _coverStandButton.hidden = [BinFaxEight commandGainRecorderPackTowerTorque];
    }
    return _coverStandButton;
}

- (void)telephotoImperialSubgroupsShortcutsArtsAction:(UIButton *)sender {
    if(self.navigationController.viewControllers.count > 1) {
        [self.view endEditing:YES];
        [self.navigationController popViewControllerAnimated:NO];
    }else {
        [self askDecryptRetForBackupAction:sender];
        [self dismissViewControllerAnimated:NO completion:nil];
    }
}

- (void)askDecryptRetForBackupAction:(UIButton *)sender {
    [[BalticFixManager shared] capturingOddWindow];
    [BinFaxEight askDecryptRetForBackupAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = BinFaxEight.icyAboutDrum.canTagEleven;

    
    self.view.backgroundColor = [BinFaxEight bankDaysGaelicInspiredReloadColor];
    NSString *regionsFriendTraverseCutHours = [BinFaxEight icyUighurTallRestoreVerifyImage];
    if (regionsFriendTraverseCutHours) {
        UIImageView *polishFireImageView = [[UIImageView alloc] init];
        polishFireImageView.contentMode = UIViewContentModeScaleAspectFill;
        polishFireImageView.clipsToBounds = YES;
        polishFireImageView.layer.cornerRadius = BinFaxEight.icyAboutDrum.canTagEleven;
        polishFireImageView.layer.masksToBounds = YES;
        [polishFireImageView sd_setImageWithURL:[NSURL URLWithString:regionsFriendTraverseCutHours]];
        [self.view insertSubview:polishFireImageView atIndex:0];
        [polishFireImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        self.lowPaddleSingleAboveDropImageView = polishFireImageView;
    }

    [self.view addSubview:self.eggSignerButton];
    [self.view addSubview:self.coverStandButton];
    
    CGFloat allSize = BinFaxEight.icyAboutDrum.croppingHand;
    [_eggSignerButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(BinFaxEight.icyAboutDrum.howShakeSix);
        make.size.mas_equalTo(CGSizeMake(allSize, allSize));
    }];
    [_coverStandButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(BinFaxEight.icyAboutDrum.howShakeSix);
        make.right.equalTo(self.view).offset(-BinFaxEight.icyAboutDrum.howShakeSix);
        make.size.mas_equalTo(CGSizeMake(allSize, allSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volatileSmallCancelSexualPubLazyFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(focusingIdleWaitingStrokeWirelessBelow:) name:UIKeyboardWillHideNotification object:nil];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self.view.superview);
        make.size.mas_equalTo([BinFaxEight clampPressedAgeFireRunningLeaseSize]);
    }];
}


- (void)volatileSmallCancelSexualPubLazyFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect chromiumFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [BalticFixManager shared].plateSuchRetWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(BinFaxEight.icyAboutDrum.resultsLighterObservingNetLawAssamese)]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
        UIView *firstResponder = [keyWindow performSelector:@selector(firstResponder)];
#pragma clang diagnostic pop
        
        if (firstResponder  && [firstResponder isKindOfClass:UITextField.class]) {

            CGRect busRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((busRect.origin.y + busRect.size.height) > chromiumFrame.origin.y) {
                CGFloat maker = ((busRect.origin.y + busRect.size.height) - chromiumFrame.origin.y) + 10;
                
                formRow(self);
                [UIView animateWithDuration:duration animations:^{
                    restExits(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -maker);
                }];
            }
        }
    }
}


- (void)focusingIdleWaitingStrokeWirelessBelow:(NSNotification *)notification{
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    formRow(self);
    [UIView animateWithDuration:duration animations:^{
        restExits(self);
        self.navigationController.view.transform = CGAffineTransformIdentity;
    }];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [super touchesEnded:touches withEvent:event];
    [self.view endEditing:YES];
}

- (void)eraserForRestBrushAll:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self.view endEditing:YES];
}

- (void)dealloc {
    
    [self.view endEditing:YES];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillHideNotification object:nil];
}

@end
