






#import "AzimuthViewController.h"

@interface AzimuthViewController ()

@end

@implementation AzimuthViewController

- (UIButton *)ductilityButton
{
    if (!_ductilityButton) {
        _ductilityButton = [[UIButton alloc] init];
        [_ductilityButton setTitle:PaceDownHue.absoluteAuto.listenChangingOurPrimariesAnyCarbon forState:UIControlStateNormal];
        [_ductilityButton setTitleColor:[PaceDownHue cropTightColor] forState:UIControlStateNormal];
        [_ductilityButton addTarget:self action:@selector(cubicPreparingSphericalGujaratiNumbersAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _ductilityButton;
}

- (UIButton *)catAtomTryButton
{
    if (!_catAtomTryButton) {
        _catAtomTryButton = [[UIButton alloc] init];
        [_catAtomTryButton setTitle:PaceDownHue.absoluteAuto.faceQueryHeartOldNoisePage forState:UIControlStateNormal];
        [_catAtomTryButton setTitleColor:[PaceDownHue cropTightColor] forState:UIControlStateNormal];
        [_catAtomTryButton addTarget:self action:@selector(summarySpeechItsAutomaticHexAction:) forControlEvents:UIControlEventTouchUpInside];
        _catAtomTryButton.hidden = [PaceDownHue rotateAttitudePerformsVortexNumeratorBefore];
    }
    return _catAtomTryButton;
}

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

- (void)summarySpeechItsAutomaticHexAction:(UIButton *)sender {
    [[AboutLikeManager shared] rawAnchorCarWindow];
    [PaceDownHue summarySpeechItsAutomaticHexAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [PaceDownHue hiddenGrowScoreMaskAttachColor];
    [self.view addSubview:self.ductilityButton];
    [self.view addSubview:self.catAtomTryButton];
    
    CGFloat napSize = PaceDownHue.absoluteAuto.tipPanRegion;
    [_ductilityButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(PaceDownHue.absoluteAuto.eggEmbedded);
        make.size.mas_equalTo(CGSizeMake(napSize, napSize));
    }];
    [_catAtomTryButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(PaceDownHue.absoluteAuto.eggEmbedded);
        make.right.equalTo(self.view).offset(-PaceDownHue.absoluteAuto.eggEmbedded);
        make.size.mas_equalTo(CGSizeMake(napSize, napSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(semanticsPetabytesExpandDogVerboseFixFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(lengthsUpdatingAlternateRuleObtainLog:) 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([PaceDownHue laterTamilMutableCollectedSquaredSpecifiedSize]);
    }];
}


- (void)semanticsPetabytesExpandDogVerboseFixFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect dateBikeFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [AboutLikeManager shared].scriptRhythmWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(PaceDownHue.absoluteAuto.notifyMembersOccurTaskSaturateActive)]) {
#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) > dateBikeFrame.origin.y) {
                CGFloat coast = ((askRect.origin.y + askRect.size.height) - dateBikeFrame.origin.y) + 10;
                
                spanish(self);
                [UIView animateWithDuration:duration animations:^{
                    initially(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -coast);
                }];
            }
        }
    }
}


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

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

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