






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

@interface ReplaceViewController ()

@end

@implementation ReplaceViewController

- (UIButton *)itsPickerButton
{
    if (!_itsPickerButton) {
        _itsPickerButton = [[UIButton alloc] init];
        [_itsPickerButton setTitle:RowGivenOut.mathProxyKin.makerRaiseGrammarDetachSecondaryLarge forState:UIControlStateNormal];
        [_itsPickerButton setTitleColor:[RowGivenOut roundWillColor] forState:UIControlStateNormal];
        [_itsPickerButton addTarget:self action:@selector(publishAbovePrefersIdleFetchAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _itsPickerButton;
}

- (UIButton *)golfRawSumButton
{
    if (!_golfRawSumButton) {
        _golfRawSumButton = [[UIButton alloc] init];
        [_golfRawSumButton setTitle:RowGivenOut.mathProxyKin.newsstandSubSexStretchRingMouth forState:UIControlStateNormal];
        [_golfRawSumButton setTitleColor:[RowGivenOut roundWillColor] forState:UIControlStateNormal];
        [_golfRawSumButton addTarget:self action:@selector(torqueOddKitTradInstallsAction:) forControlEvents:UIControlEventTouchUpInside];
        _golfRawSumButton.hidden = [RowGivenOut boundingGaelicProxyBondGuestShear];
    }
    return _golfRawSumButton;
}

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

- (void)torqueOddKitTradInstallsAction:(UIButton *)sender {
    [[CapUniqueManager shared] scanCroatianWindow];
    [RowGivenOut torqueOddKitTradInstallsAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = RowGivenOut.mathProxyKin.delayBinDash;

    
    self.view.backgroundColor = [RowGivenOut taskFormatsRepliesCupSucceededColor];
    NSString *thermalFatChunkNetLate = [RowGivenOut slightChangedMeasureCallbacksRepublicImage];
    if (thermalFatChunkNetLate) {
        UIImageView *cascadeKitImageView = [[UIImageView alloc] init];
        cascadeKitImageView.contentMode = UIViewContentModeScaleAspectFill;
        cascadeKitImageView.clipsToBounds = YES;
        cascadeKitImageView.layer.cornerRadius = RowGivenOut.mathProxyKin.delayBinDash;
        cascadeKitImageView.layer.masksToBounds = YES;
        [cascadeKitImageView sd_setImageWithURL:[NSURL URLWithString:thermalFatChunkNetLate]];
        [self.view insertSubview:cascadeKitImageView atIndex:0];
        [cascadeKitImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        self.buddyExclusiveFeedbackFourMattingImageView = cascadeKitImageView;
    }

    [self.view addSubview:self.itsPickerButton];
    [self.view addSubview:self.golfRawSumButton];
    
    CGFloat bedSize = RowGivenOut.mathProxyKin.anyHalfMagic;
    [_itsPickerButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(RowGivenOut.mathProxyKin.theSumThick);
        make.size.mas_equalTo(CGSizeMake(bedSize, bedSize));
    }];
    [_golfRawSumButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(RowGivenOut.mathProxyKin.theSumThick);
        make.right.equalTo(self.view).offset(-RowGivenOut.mathProxyKin.theSumThick);
        make.size.mas_equalTo(CGSizeMake(bedSize, bedSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(schemeRestoresBlinkExecutionObservedSmoothingFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(entryFathomsPredicateBoxLongSmall:) 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([RowGivenOut adjustSensitiveKernelSwipeButEsperantoSize]);
    }];
}


- (void)schemeRestoresBlinkExecutionObservedSmoothingFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect kitPointFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [CapUniqueManager shared].leaveRedBestWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(RowGivenOut.mathProxyKin.tradSwipeDeriveValidatesPoolWas)]) {
#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 minRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((minRect.origin.y + minRect.size.height) > kitPointFrame.origin.y) {
                CGFloat foggy = ((minRect.origin.y + minRect.size.height) - kitPointFrame.origin.y) + 10;
                
                moveDay(self);
                [UIView animateWithDuration:duration animations:^{
                    tapsAlong(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -foggy);
                }];
            }
        }
    }
}


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

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

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