






#import "OrdinalViewController.h"

@interface OrdinalViewController ()

@end

@implementation OrdinalViewController

- (UIButton *)romanGoalButton
{
    if (!_romanGoalButton) {
        _romanGoalButton = [[UIButton alloc] init];
        [_romanGoalButton setTitle:DidTodayWax.invitePencil.lexicalPrintAnchorsStayAppearsRadio forState:UIControlStateNormal];
        [_romanGoalButton setTitleColor:[DidTodayWax designSpaColor] forState:UIControlStateNormal];
        [_romanGoalButton addTarget:self action:@selector(cadencePrincipalFaceReachableRoleAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _romanGoalButton;
}

- (UIButton *)smallBayerButton
{
    if (!_smallBayerButton) {
        _smallBayerButton = [[UIButton alloc] init];
        [_smallBayerButton setTitle:DidTodayWax.invitePencil.semanticsInterruptWeekdaySymmetricArcadeAlgorithm forState:UIControlStateNormal];
        [_smallBayerButton setTitleColor:[DidTodayWax designSpaColor] forState:UIControlStateNormal];
        [_smallBayerButton addTarget:self action:@selector(indianWordAmbientDefineEllipseAction:) forControlEvents:UIControlEventTouchUpInside];
        _smallBayerButton.hidden = [DidTodayWax abortedFigureStatementPointerImportantSmallest];
    }
    return _smallBayerButton;
}

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

- (void)indianWordAmbientDefineEllipseAction:(UIButton *)sender {
    [[SexualSobManager shared] forGenreSideWindow];
    [DidTodayWax indianWordAmbientDefineEllipseAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [DidTodayWax sessionEnumerateGrammarYouRenameColor];
    [self.view addSubview:self.romanGoalButton];
    [self.view addSubview:self.smallBayerButton];
    
    CGFloat youSize = DidTodayWax.invitePencil.optCutterYet;
    [_romanGoalButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(DidTodayWax.invitePencil.ropeHelpMan);
        make.size.mas_equalTo(CGSizeMake(youSize, youSize));
    }];
    [_smallBayerButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(DidTodayWax.invitePencil.ropeHelpMan);
        make.right.equalTo(self.view).offset(-DidTodayWax.invitePencil.ropeHelpMan);
        make.size.mas_equalTo(CGSizeMake(youSize, youSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(bleedSwapServerElderPriceFatalFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(operatorSplatCardioidShortRandomHex:) 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([DidTodayWax checkoutOldButtonLenientNapAbortedSize]);
    }];
}


- (void)bleedSwapServerElderPriceFatalFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect varianceFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [SexualSobManager shared].builtSeekingWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(DidTodayWax.invitePencil.calciumColumnsReasonThinEditorsAlways)]) {
#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 sonRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((sonRect.origin.y + sonRect.size.height) > varianceFrame.origin.y) {
                CGFloat bezel = ((sonRect.origin.y + sonRect.size.height) - varianceFrame.origin.y) + 10;
                
                prefers(self);
                [UIView animateWithDuration:duration animations:^{
                    belowSent(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -bezel);
                }];
            }
        }
    }
}


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

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

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