






#import "PullBitViewController.h"

@interface PullBitViewController ()

@end

@implementation PullBitViewController

- (UIButton *)ornamentsButton
{
    if (!_ornamentsButton) {
        _ornamentsButton = [[UIButton alloc] init];
        [_ornamentsButton setTitle:BadMeanSame.clockwiseSun.baselinesStrongDenyPressClaimUsability forState:UIControlStateNormal];
        [_ornamentsButton setTitleColor:[BadMeanSame observersColor] forState:UIControlStateNormal];
        [_ornamentsButton addTarget:self action:@selector(feedPeriodicPlusEngravedManualAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _ornamentsButton;
}

- (UIButton *)redPanSlowButton
{
    if (!_redPanSlowButton) {
        _redPanSlowButton = [[UIButton alloc] init];
        [_redPanSlowButton setTitle:BadMeanSame.clockwiseSun.baseExpandedAnchoringHexDetectorOcclusion forState:UIControlStateNormal];
        [_redPanSlowButton setTitleColor:[BadMeanSame observersColor] forState:UIControlStateNormal];
        [_redPanSlowButton addTarget:self action:@selector(badmintonLawInjectionCallShoulderAction:) forControlEvents:UIControlEventTouchUpInside];
        _redPanSlowButton.hidden = [BadMeanSame commonIdleIgnoreChromaticLockGranted];
    }
    return _redPanSlowButton;
}

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

- (void)badmintonLawInjectionCallShoulderAction:(UIButton *)sender {
    [[WeekLayerManager shared] stoneLateFatWindow];
    [BadMeanSame badmintonLawInjectionCallShoulderAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [BadMeanSame animatorUnifiedSideWhoRedColor];
    [self.view addSubview:self.ornamentsButton];
    [self.view addSubview:self.redPanSlowButton];
    
    CGFloat ownSize = BadMeanSame.clockwiseSun.paceBouncing;
    [_ornamentsButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(BadMeanSame.clockwiseSun.forkSinSent);
        make.size.mas_equalTo(CGSizeMake(ownSize, ownSize));
    }];
    [_redPanSlowButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(BadMeanSame.clockwiseSun.forkSinSent);
        make.right.equalTo(self.view).offset(-BadMeanSame.clockwiseSun.forkSinSent);
        make.size.mas_equalTo(CGSizeMake(ownSize, ownSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(suddenDetectorSearchFlipSaltSmoothedFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(secondaryStrokedPastTripleActionEvict:) 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([BadMeanSame looseHeightTableChannelsScalarHandledSize]);
    }];
}


- (void)suddenDetectorSearchFlipSaltSmoothedFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect powerOddFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [WeekLayerManager shared].geometricFaxWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(BadMeanSame.clockwiseSun.emergencyRowOffAndUploadedDense)]) {
#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 kinRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((kinRect.origin.y + kinRect.size.height) > powerOddFrame.origin.y) {
                CGFloat child = ((kinRect.origin.y + kinRect.size.height) - powerOddFrame.origin.y) + 10;
                
                soloDry(self);
                [UIView animateWithDuration:duration animations:^{
                    howCreate(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -child);
                }];
            }
        }
    }
}


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

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

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