






#import "ClosureViewController.h"

@interface ClosureViewController ()

@end

@implementation ClosureViewController

- (UIButton *)redoHertzButton
{
    if (!_redoHertzButton) {
        _redoHertzButton = [[UIButton alloc] init];
        [_redoHertzButton setTitle:FeedSunTied.rootIntegral.outcomeBundlePortionHyphenSquashHectares forState:UIControlStateNormal];
        [_redoHertzButton setTitleColor:[FeedSunTied genderPinColor] forState:UIControlStateNormal];
        [_redoHertzButton addTarget:self action:@selector(treeGetAlienMantissaPairAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _redoHertzButton;
}

- (UIButton *)nowEquallyButton
{
    if (!_nowEquallyButton) {
        _nowEquallyButton = [[UIButton alloc] init];
        [_nowEquallyButton setTitle:FeedSunTied.rootIntegral.polarGolfBoostSentenceLocalizesAngle forState:UIControlStateNormal];
        [_nowEquallyButton setTitleColor:[FeedSunTied genderPinColor] forState:UIControlStateNormal];
        [_nowEquallyButton addTarget:self action:@selector(dropLongestEncryptedUnpluggedBloodAction:) forControlEvents:UIControlEventTouchUpInside];
        _nowEquallyButton.hidden = [FeedSunTied paletteSigmaArmourSilencedPaletteForce];
    }
    return _nowEquallyButton;
}

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

- (void)dropLongestEncryptedUnpluggedBloodAction:(UIButton *)sender {
    [[TimeClaimManager shared] dryTabPacketWindow];
    [FeedSunTied dropLongestEncryptedUnpluggedBloodAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [FeedSunTied grantedWonSliceVisualRelatedColor];
    [self.view addSubview:self.redoHertzButton];
    [self.view addSubview:self.nowEquallyButton];
    
    CGFloat maxSize = FeedSunTied.rootIntegral.encryptEmail;
    [_redoHertzButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(FeedSunTied.rootIntegral.sequenceHit);
        make.size.mas_equalTo(CGSizeMake(maxSize, maxSize));
    }];
    [_nowEquallyButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(FeedSunTied.rootIntegral.sequenceHit);
        make.right.equalTo(self.view).offset(-FeedSunTied.rootIntegral.sequenceHit);
        make.size.mas_equalTo(CGSizeMake(maxSize, maxSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(whoMediumMaterialTrySinhaleseOriginFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(caretSpouseSpaSerbianTurnExpand:) 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([FeedSunTied coercionAnnotatedTailFadeEqualAskSize]);
    }];
}


- (void)whoMediumMaterialTrySinhaleseOriginFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect laterCarFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [TimeClaimManager shared].fourInspiredWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(FeedSunTied.rootIntegral.pauseAvailPromisedStableCircleBalanced)]) {
#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 hasRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((hasRect.origin.y + hasRect.size.height) > laterCarFrame.origin.y) {
                CGFloat about = ((hasRect.origin.y + hasRect.size.height) - laterCarFrame.origin.y) + 10;
                
                vitamin(self);
                [UIView animateWithDuration:duration animations:^{
                    peakSlice(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -about);
                }];
            }
        }
    }
}


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

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

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