






#import "BagHighViewController.h"

@interface BagHighViewController ()

@end

@implementation BagHighViewController

- (UIButton *)lengthLawButton
{
    if (!_lengthLawButton) {
        _lengthLawButton = [[UIButton alloc] init];
        [_lengthLawButton setTitle:SkinMeanYet.reloadRawDay.fetchOutputsTraveledWaistLargeBuild forState:UIControlStateNormal];
        [_lengthLawButton setTitleColor:[SkinMeanYet rotateWonColor] forState:UIControlStateNormal];
        [_lengthLawButton addTarget:self action:@selector(endGreekAlarmMayFloaterAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _lengthLawButton;
}

- (UIButton *)nonceFlashButton
{
    if (!_nonceFlashButton) {
        _nonceFlashButton = [[UIButton alloc] init];
        [_nonceFlashButton setTitle:SkinMeanYet.reloadRawDay.farDescendDingbatsTorchPositionsStalled forState:UIControlStateNormal];
        [_nonceFlashButton setTitleColor:[SkinMeanYet rotateWonColor] forState:UIControlStateNormal];
        [_nonceFlashButton addTarget:self action:@selector(parserBikeAdditionsExpandHeightAction:) forControlEvents:UIControlEventTouchUpInside];
        _nonceFlashButton.hidden = [SkinMeanYet gramEncipherKitSunHexTriple];
    }
    return _nonceFlashButton;
}

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

- (void)parserBikeAdditionsExpandHeightAction:(UIButton *)sender {
    [[TeaspoonsManager shared] cupMainStoreWindow];
    [SkinMeanYet parserBikeAdditionsExpandHeightAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [SkinMeanYet busSliceRecentlyCalciumFitColor];
    [self.view addSubview:self.lengthLawButton];
    [self.view addSubview:self.nonceFlashButton];
    
    CGFloat askSize = SkinMeanYet.reloadRawDay.unionForLess;
    [_lengthLawButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(SkinMeanYet.reloadRawDay.sonFollower);
        make.size.mas_equalTo(CGSizeMake(askSize, askSize));
    }];
    [_nonceFlashButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(SkinMeanYet.reloadRawDay.sonFollower);
        make.right.equalTo(self.view).offset(-SkinMeanYet.reloadRawDay.sonFollower);
        make.size.mas_equalTo(CGSizeMake(askSize, askSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(soccerExpectingCompoundCanonicalCrossExpensiveFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(partlyIconLowerKilobytesSigmaExpect:) 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([SkinMeanYet yiddishLandscapeNegotiateBadRestoredOptSize]);
    }];
}


- (void)soccerExpectingCompoundCanonicalCrossExpensiveFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect itemBendFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [TeaspoonsManager shared].ourHostPhaseWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(SkinMeanYet.reloadRawDay.pullMillibarsBalticClangAliveLoud)]) {
#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 jobRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((jobRect.origin.y + jobRect.size.height) > itemBendFrame.origin.y) {
                CGFloat dance = ((jobRect.origin.y + jobRect.size.height) - itemBendFrame.origin.y) + 10;
                
                bondIcy(self);
                [UIView animateWithDuration:duration animations:^{
                    askArtery(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -dance);
                }];
            }
        }
    }
}


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

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

- (void)menstrualExternalWorkspaceCellBoundary:(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
