






#import "PersistViewController.h"

@interface PersistViewController ()

@end

@implementation PersistViewController

- (UIButton *)somaliSeeButton
{
    if (!_somaliSeeButton) {
        _somaliSeeButton = [[UIButton alloc] init];
        [_somaliSeeButton setTitle:BinTopLemma.drainCatFair.rotorLambdaBondStylizeLocationsSentinel forState:UIControlStateNormal];
        [_somaliSeeButton setTitleColor:[BinTopLemma diskBuiltColor] forState:UIControlStateNormal];
        [_somaliSeeButton addTarget:self action:@selector(sumOddPresentedMathQuotationAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _somaliSeeButton;
}

- (UIButton *)openCatArmButton
{
    if (!_openCatArmButton) {
        _openCatArmButton = [[UIButton alloc] init];
        [_openCatArmButton setTitle:BinTopLemma.drainCatFair.intensityLooseDismissedDiscoveryAllBulgarian forState:UIControlStateNormal];
        [_openCatArmButton setTitleColor:[BinTopLemma diskBuiltColor] forState:UIControlStateNormal];
        [_openCatArmButton addTarget:self action:@selector(collapseAssistivePedometerTradBothAction:) forControlEvents:UIControlEventTouchUpInside];
        _openCatArmButton.hidden = [BinTopLemma chromaticSymbolsDismissalSequencesTradPipe];
    }
    return _openCatArmButton;
}

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

- (void)collapseAssistivePedometerTradBothAction:(UIButton *)sender {
    [[ChunkyGetManager shared] airOverwriteWindow];
    [BinTopLemma collapseAssistivePedometerTradBothAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [BinTopLemma unboundedResponsePersonInhalerBatteryColor];
    [self.view addSubview:self.somaliSeeButton];
    [self.view addSubview:self.openCatArmButton];
    
    CGFloat twoSize = BinTopLemma.drainCatFair.nameAdvances;
    [_somaliSeeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(BinTopLemma.drainCatFair.danceBetter);
        make.size.mas_equalTo(CGSizeMake(twoSize, twoSize));
    }];
    [_openCatArmButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(BinTopLemma.drainCatFair.danceBetter);
        make.right.equalTo(self.view).offset(-BinTopLemma.drainCatFair.danceBetter);
        make.size.mas_equalTo(CGSizeMake(twoSize, twoSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(executionRelayMainBagProvidingActivateFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(previewFilteringPanelCycleCompositePop:) 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([BinTopLemma measuredSpokenCanadianJustifiedOptionCursiveSize]);
    }];
}


- (void)executionRelayMainBagProvidingActivateFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect restoredFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [ChunkyGetManager shared].identicalDogWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(BinTopLemma.drainCatFair.dailyOddClickedAllowableQualifiedElements)]) {
#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 hueRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((hueRect.origin.y + hueRect.size.height) > restoredFrame.origin.y) {
                CGFloat never = ((hueRect.origin.y + hueRect.size.height) - restoredFrame.origin.y) + 10;
                
                rawTurn(self);
                [UIView animateWithDuration:duration animations:^{
                    exactWarn(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -never);
                }];
            }
        }
    }
}


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

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

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