






#import "UseBookViewController.h"

@interface UseBookViewController ()

@end

@implementation UseBookViewController

- (UIButton *)canCreamyButton
{
    if (!_canCreamyButton) {
        _canCreamyButton = [[UIButton alloc] init];
        [_canCreamyButton setTitle:MenuCluster.thirteenHand.givenOppositeOldestLinerCapturePath forState:UIControlStateNormal];
        [_canCreamyButton setTitleColor:[MenuCluster footerButColor] forState:UIControlStateNormal];
        [_canCreamyButton addTarget:self action:@selector(yearsProducedRenamingLeakyExportedAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _canCreamyButton;
}

- (UIButton *)subLoadSumButton
{
    if (!_subLoadSumButton) {
        _subLoadSumButton = [[UIButton alloc] init];
        [_subLoadSumButton setTitle:MenuCluster.thirteenHand.orderingFalloffPromptBurnEstablishNode forState:UIControlStateNormal];
        [_subLoadSumButton setTitleColor:[MenuCluster footerButColor] forState:UIControlStateNormal];
        [_subLoadSumButton addTarget:self action:@selector(noneHostBalancePintRegionsAction:) forControlEvents:UIControlEventTouchUpInside];
        _subLoadSumButton.hidden = [MenuCluster eyePortalEncodeViolationPhoneSwashes];
    }
    return _subLoadSumButton;
}

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

- (void)noneHostBalancePintRegionsAction:(UIButton *)sender {
    [[PotentialManager shared] functionsAndWindow];
    [MenuCluster noneHostBalancePintRegionsAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [MenuCluster arteryMaleToleranceHaveOptColor];
    [self.view addSubview:self.canCreamyButton];
    [self.view addSubview:self.subLoadSumButton];
    
    CGFloat jobSize = MenuCluster.thirteenHand.sayIconLevel;
    [_canCreamyButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(MenuCluster.thirteenHand.chunkyMolar);
        make.size.mas_equalTo(CGSizeMake(jobSize, jobSize));
    }];
    [_subLoadSumButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(MenuCluster.thirteenHand.chunkyMolar);
        make.right.equalTo(self.view).offset(-MenuCluster.thirteenHand.chunkyMolar);
        make.size.mas_equalTo(CGSizeMake(jobSize, jobSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(immutableUniformSerifTooShowDeriveFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(footerPartialFlightPanoramasGigabitsCall:) 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([MenuCluster visitLookFeedAmbientSeparatorMustSize]);
    }];
}


- (void)immutableUniformSerifTooShowDeriveFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect hashWarpFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [PotentialManager shared].tapHalfOrderWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(MenuCluster.thirteenHand.whileDrawFragmentShipmentUbiquityCollapse)]) {
#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 illRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((illRect.origin.y + illRect.size.height) > hashWarpFrame.origin.y) {
                CGFloat outer = ((illRect.origin.y + illRect.size.height) - hashWarpFrame.origin.y) + 10;
                
                delayed(self);
                [UIView animateWithDuration:duration animations:^{
                    different(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -outer);
                }];
            }
        }
    }
}


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

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

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