






#import "RemovalViewController.h"
#import "UIImageView+WebCache.h"

@interface RemovalViewController ()

@end

@implementation RemovalViewController

- (UIButton *)ironPaperButton
{
    if (!_ironPaperButton) {
        _ironPaperButton = [[UIButton alloc] init];
        [_ironPaperButton setTitle:YahooKeyTip.tatarMaximum.unlockedPromptClangFadeDisablesStiffness forState:UIControlStateNormal];
        [_ironPaperButton setTitleColor:[YahooKeyTip animatingColor] forState:UIControlStateNormal];
        [_ironPaperButton addTarget:self action:@selector(motionReachedRomanianDialogDueAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _ironPaperButton;
}

- (UIButton *)theGuaraniButton
{
    if (!_theGuaraniButton) {
        _theGuaraniButton = [[UIButton alloc] init];
        [_theGuaraniButton setTitle:YahooKeyTip.tatarMaximum.shrinkCancelsUtteranceSphereLongitudeSystolic forState:UIControlStateNormal];
        [_theGuaraniButton setTitleColor:[YahooKeyTip animatingColor] forState:UIControlStateNormal];
        [_theGuaraniButton addTarget:self action:@selector(pressesPreciseVoiceLargeTemporaryAction:) forControlEvents:UIControlEventTouchUpInside];
        _theGuaraniButton.hidden = [YahooKeyTip entriesStableSkinPrefersCatReturned];
    }
    return _theGuaraniButton;
}

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

- (void)pressesPreciseVoiceLargeTemporaryAction:(UIButton *)sender {
    [[AggregateManager shared] awakePenCityWindow];
    [YahooKeyTip pressesPreciseVoiceLargeTemporaryAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = YahooKeyTip.tatarMaximum.ironKinChain;

    
    self.view.backgroundColor = [YahooKeyTip saveInsertedGesturesDisabledFootersColor];
    NSString *diskParsingPartiallyLeaveInsertion = [YahooKeyTip volumesButInternetBroadcastFriendsImage];
    if (diskParsingPartiallyLeaveInsertion) {
        UIImageView *invalidTagImageView = [[UIImageView alloc] init];
        invalidTagImageView.contentMode = UIViewContentModeScaleAspectFill;
        invalidTagImageView.clipsToBounds = YES;
        invalidTagImageView.layer.cornerRadius = YahooKeyTip.tatarMaximum.ironKinChain;
        invalidTagImageView.layer.masksToBounds = YES;
        [invalidTagImageView sd_setImageWithURL:[NSURL URLWithString:diskParsingPartiallyLeaveInsertion]];
        [self.view insertSubview:invalidTagImageView atIndex:0];
        [invalidTagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        self.waxAgeLateAudibleArbiterImageView = invalidTagImageView;
    }

    [self.view addSubview:self.ironPaperButton];
    [self.view addSubview:self.theGuaraniButton];
    
    CGFloat oddSize = YahooKeyTip.tatarMaximum.indoorAffine;
    [_ironPaperButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(YahooKeyTip.tatarMaximum.looperGreat);
        make.size.mas_equalTo(CGSizeMake(oddSize, oddSize));
    }];
    [_theGuaraniButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(YahooKeyTip.tatarMaximum.looperGreat);
        make.right.equalTo(self.view).offset(-YahooKeyTip.tatarMaximum.looperGreat);
        make.size.mas_equalTo(CGSizeMake(oddSize, oddSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(readerAccurateAirTensionSoloAscentFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(forbidCutOneJustifiedSumRhythm:) 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([YahooKeyTip teacherSilenceMultipleMailGaspRetSize]);
    }];
}


- (void)readerAccurateAirTensionSoloAscentFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect eventRedFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [AggregateManager shared].mediaToneButWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(YahooKeyTip.tatarMaximum.artsBoldfaceObservingStrictlyBiotinSpan)]) {
#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 askRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((askRect.origin.y + askRect.size.height) > eventRedFrame.origin.y) {
                CGFloat small = ((askRect.origin.y + askRect.size.height) - eventRedFrame.origin.y) + 10;
                
                topLike(self);
                [UIView animateWithDuration:duration animations:^{
                    dogManual(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -small);
                }];
            }
        }
    }
}


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

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

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