






#import "OutFadeViewController.h"

@interface OutFadeViewController ()

@end

@implementation OutFadeViewController

- (UIButton *)areShadowButton
{
    if (!_areShadowButton) {
        _areShadowButton = [[UIButton alloc] init];
        [_areShadowButton setTitle:ButPhonetic.ditheredFast.containsPanoramaIconBoldMaxEscapes forState:UIControlStateNormal];
        [_areShadowButton setTitleColor:[ButPhonetic veryValueColor] forState:UIControlStateNormal];
        [_areShadowButton addTarget:self action:@selector(rowTiedDrawPartRadiansAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _areShadowButton;
}

- (UIButton *)crossClampButton
{
    if (!_crossClampButton) {
        _crossClampButton = [[UIButton alloc] init];
        [_crossClampButton setTitle:ButPhonetic.ditheredFast.appendLawShowEnterEditGather forState:UIControlStateNormal];
        [_crossClampButton setTitleColor:[ButPhonetic veryValueColor] forState:UIControlStateNormal];
        [_crossClampButton addTarget:self action:@selector(declineDueFeatureInsertFourAction:) forControlEvents:UIControlEventTouchUpInside];
        _crossClampButton.hidden = [ButPhonetic arcadeArteryBeenInviteeHandshakeMounted];
    }
    return _crossClampButton;
}

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

- (void)declineDueFeatureInsertFourAction:(UIButton *)sender {
    [[WasFillerManager shared] saltTrailingWindow];
    [ButPhonetic declineDueFeatureInsertFourAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [ButPhonetic compositeShapeWarningRepublicSonColor];
    [self.view addSubview:self.areShadowButton];
    [self.view addSubview:self.crossClampButton];
    
    CGFloat panSize = ButPhonetic.ditheredFast.linerDarkHas;
    [_areShadowButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(ButPhonetic.ditheredFast.alarmCancel);
        make.size.mas_equalTo(CGSizeMake(panSize, panSize));
    }];
    [_crossClampButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(ButPhonetic.ditheredFast.alarmCancel);
        make.right.equalTo(self.view).offset(-ButPhonetic.ditheredFast.alarmCancel);
        make.size.mas_equalTo(CGSizeMake(panSize, panSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(kilometerDisappearUnionMonthPreparedTenFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(parentalIcyExclusiveCyrillicRadixRope:) 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([ButPhonetic uplinkWorkspaceSendClickedLongerLawSize]);
    }];
}


- (void)kilometerDisappearUnionMonthPreparedTenFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect proxyWetFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [WasFillerManager shared].delaySubPickWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(ButPhonetic.ditheredFast.winSmartBurstOurBusCube)]) {
#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 wetRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((wetRect.origin.y + wetRect.size.height) > proxyWetFrame.origin.y) {
                CGFloat waist = ((wetRect.origin.y + wetRect.size.height) - proxyWetFrame.origin.y) + 10;
                
                yetGram(self);
                [UIView animateWithDuration:duration animations:^{
                    herScript(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -waist);
                }];
            }
        }
    }
}


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

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

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