






#import "PreventViewController.h"

@interface PreventViewController ()

@end

@implementation PreventViewController

- (UIButton *)vowelMostButton
{
    if (!_vowelMostButton) {
        _vowelMostButton = [[UIButton alloc] init];
        [_vowelMostButton setTitle:FixMaterial.capsLoopsAge.splitTalkBehaveIncomingChatDistance forState:UIControlStateNormal];
        [_vowelMostButton setTitleColor:[FixMaterial burnEarlyColor] forState:UIControlStateNormal];
        [_vowelMostButton addTarget:self action:@selector(topLeakyDissolveVisualSongAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _vowelMostButton;
}

- (UIButton *)blobLogKinButton
{
    if (!_blobLogKinButton) {
        _blobLogKinButton = [[UIButton alloc] init];
        [_blobLogKinButton setTitle:FixMaterial.capsLoopsAge.prepReminderCausePubMindfulDash forState:UIControlStateNormal];
        [_blobLogKinButton setTitleColor:[FixMaterial burnEarlyColor] forState:UIControlStateNormal];
        [_blobLogKinButton addTarget:self action:@selector(minderCardioidAlgorithmDoubleIntroAction:) forControlEvents:UIControlEventTouchUpInside];
        _blobLogKinButton.hidden = [FixMaterial uighurLookDependingBadgePredicateGranted];
    }
    return _blobLogKinButton;
}

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

- (void)minderCardioidAlgorithmDoubleIntroAction:(UIButton *)sender {
    [[NextBeganManager shared] bedAreWidgetWindow];
    [FixMaterial minderCardioidAlgorithmDoubleIntroAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [FixMaterial referenceTapsWorkspaceIgnoredIdentityColor];
    [self.view addSubview:self.vowelMostButton];
    [self.view addSubview:self.blobLogKinButton];
    
    CGFloat eggSize = FixMaterial.capsLoopsAge.sayDomainCup;
    [_vowelMostButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(FixMaterial.capsLoopsAge.bloodZipOld);
        make.size.mas_equalTo(CGSizeMake(eggSize, eggSize));
    }];
    [_blobLogKinButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(FixMaterial.capsLoopsAge.bloodZipOld);
        make.right.equalTo(self.view).offset(-FixMaterial.capsLoopsAge.bloodZipOld);
        make.size.mas_equalTo(CGSizeMake(eggSize, eggSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(linkageAsteriskLambdaCutterAnchorArteryFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(oddWorkflowTruncateSignGoldenCenter:) 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([FixMaterial elevatedReplacedMisplacedEqualityFlippedRevealedSize]);
    }];
}


- (void)linkageAsteriskLambdaCutterAnchorArteryFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect kitLeakyFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [NextBeganManager shared].bedHasEnableWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(FixMaterial.capsLoopsAge.megawattsDiscreteGallonGaussianBringLook)]) {
#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 cupRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((cupRect.origin.y + cupRect.size.height) > kitLeakyFrame.origin.y) {
                CGFloat stand = ((cupRect.origin.y + cupRect.size.height) - kitLeakyFrame.origin.y) + 10;
                
                sheLess(self);
                [UIView animateWithDuration:duration animations:^{
                    condensed(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -stand);
                }];
            }
        }
    }
}


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

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

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