






#import "SonMoleViewController.h"

@interface SonMoleViewController ()

@end

@implementation SonMoleViewController

- (UIButton *)extrasIcyButton
{
    if (!_extrasIcyButton) {
        _extrasIcyButton = [[UIButton alloc] init];
        [_extrasIcyButton setTitle:LeftHosting.busJobRemote.initiatedHeapStylizeTatarCompileRotation forState:UIControlStateNormal];
        [_extrasIcyButton setTitleColor:[LeftHosting beganNearColor] forState:UIControlStateNormal];
        [_extrasIcyButton addTarget:self action:@selector(spousesInitialSidebarWirePrefixAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _extrasIcyButton;
}

- (UIButton *)sinDefinedButton
{
    if (!_sinDefinedButton) {
        _sinDefinedButton = [[UIButton alloc] init];
        [_sinDefinedButton setTitle:LeftHosting.busJobRemote.allergyLocationsVerboseLocalizedBracketedRoute forState:UIControlStateNormal];
        [_sinDefinedButton setTitleColor:[LeftHosting beganNearColor] forState:UIControlStateNormal];
        [_sinDefinedButton addTarget:self action:@selector(secondAppendedTwoFixArtistAction:) forControlEvents:UIControlEventTouchUpInside];
        _sinDefinedButton.hidden = [LeftHosting subfamilyYearsVendorUnifyContainRemembers];
    }
    return _sinDefinedButton;
}

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

- (void)secondAppendedTwoFixArtistAction:(UIButton *)sender {
    [[AspectTapManager shared] levelCreatorWindow];
    [LeftHosting secondAppendedTwoFixArtistAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [LeftHosting mixerSinkZoomingIcyCleanColor];
    [self.view addSubview:self.extrasIcyButton];
    [self.view addSubview:self.sinDefinedButton];
    
    CGFloat catSize = LeftHosting.busJobRemote.focalZeroFun;
    [_extrasIcyButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(LeftHosting.busJobRemote.airborneNet);
        make.size.mas_equalTo(CGSizeMake(catSize, catSize));
    }];
    [_sinDefinedButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(LeftHosting.busJobRemote.airborneNet);
        make.right.equalTo(self.view).offset(-LeftHosting.busJobRemote.airborneNet);
        make.size.mas_equalTo(CGSizeMake(catSize, catSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(lettishTheTildeSelectedCycleConsumerFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(collapsedPreventSettingSampleEventualSwipe:) 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([LeftHosting leakyCaretTurnThePaceDomainsSize]);
    }];
}


- (void)lettishTheTildeSelectedCycleConsumerFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect personalFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [AspectTapManager shared].danishSawSexWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(LeftHosting.busJobRemote.signalTemporaryTradWatchPeakLevel)]) {
#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 capRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((capRect.origin.y + capRect.size.height) > personalFrame.origin.y) {
                CGFloat cubic = ((capRect.origin.y + capRect.size.height) - personalFrame.origin.y) + 10;
                
                sampler(self);
                [UIView animateWithDuration:duration animations:^{
                    longerSun(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -cubic);
                }];
            }
        }
    }
}


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

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

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