






#import "MinHardViewController.h"

@interface MinHardViewController ()

@end

@implementation MinHardViewController

- (UIButton *)agePreferButton
{
    if (!_agePreferButton) {
        _agePreferButton = [[UIButton alloc] init];
        [_agePreferButton setTitle:HerLaunched.brownFairKin.mobileShakeAnyCameraDirtyRecursive forState:UIControlStateNormal];
        [_agePreferButton setTitleColor:[HerLaunched mixQuotesColor] forState:UIControlStateNormal];
        [_agePreferButton addTarget:self action:@selector(circularBracketBoxFlagPersonalAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _agePreferButton;
}

- (UIButton *)workOuncesButton
{
    if (!_workOuncesButton) {
        _workOuncesButton = [[UIButton alloc] init];
        [_workOuncesButton setTitle:HerLaunched.brownFairKin.dispenseOpaqueSameChromaticFrequencyMid forState:UIControlStateNormal];
        [_workOuncesButton setTitleColor:[HerLaunched mixQuotesColor] forState:UIControlStateNormal];
        [_workOuncesButton addTarget:self action:@selector(gainSnapEntryIntrinsicSurgeAction:) forControlEvents:UIControlEventTouchUpInside];
        _workOuncesButton.hidden = [HerLaunched cadenceScrollEraserTensionTraitOutput];
    }
    return _workOuncesButton;
}

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

- (void)gainSnapEntryIntrinsicSurgeAction:(UIButton *)sender {
    [[NiacinBigManager shared] anchoringIcyWindow];
    [HerLaunched gainSnapEntryIntrinsicSurgeAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [HerLaunched radioPolarHexFixCombiningColor];
    [self.view addSubview:self.agePreferButton];
    [self.view addSubview:self.workOuncesButton];
    
    CGFloat pinSize = HerLaunched.brownFairKin.pathPopHuman;
    [_agePreferButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(HerLaunched.brownFairKin.scanAskCurl);
        make.size.mas_equalTo(CGSizeMake(pinSize, pinSize));
    }];
    [_workOuncesButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(HerLaunched.brownFairKin.scanAskCurl);
        make.right.equalTo(self.view).offset(-HerLaunched.brownFairKin.scanAskCurl);
        make.size.mas_equalTo(CGSizeMake(pinSize, pinSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(gallonsPathSlowStrategyMaleResolvedFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(parallelDisappearLowLocalizedCentralsRussian:) 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([HerLaunched developerThumbEncodingsPromisedHeadEggSize]);
    }];
}


- (void)gallonsPathSlowStrategyMaleResolvedFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect radioRawFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [NiacinBigManager shared].bagHexStaticWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(HerLaunched.brownFairKin.trialUndonePashtoStepPanCup)]) {
#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 askRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((askRect.origin.y + askRect.size.height) > radioRawFrame.origin.y) {
                CGFloat caret = ((askRect.origin.y + askRect.size.height) - radioRawFrame.origin.y) + 10;
                
                waitCat(self);
                [UIView animateWithDuration:duration animations:^{
                    axesMicro(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -caret);
                }];
            }
        }
    }
}


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

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

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