






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

@interface WonFoodViewController ()

@end

@implementation WonFoodViewController

- (UIButton *)nearHumanButton
{
    if (!_nearHumanButton) {
        _nearHumanButton = [[UIButton alloc] init];
        [_nearHumanButton setTitle:PartialBest.mouseEarlier.kilovoltsAuditMandatoryBigRowTitle forState:UIControlStateNormal];
        [_nearHumanButton setTitleColor:[PartialBest genreJumpColor] forState:UIControlStateNormal];
        [_nearHumanButton addTarget:self action:@selector(indianCheckingPassPascalWetAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _nearHumanButton;
}

- (UIButton *)declineRawButton
{
    if (!_declineRawButton) {
        _declineRawButton = [[UIButton alloc] init];
        [_declineRawButton setTitle:PartialBest.mouseEarlier.bothBuddyCarbonSpatialLogView forState:UIControlStateNormal];
        [_declineRawButton setTitleColor:[PartialBest genreJumpColor] forState:UIControlStateNormal];
        [_declineRawButton addTarget:self action:@selector(finnishSaveOwnershipMicroRetAction:) forControlEvents:UIControlEventTouchUpInside];
        _declineRawButton.hidden = [PartialBest uniquePartlyMetalFeatureShotRow];
    }
    return _declineRawButton;
}

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

- (void)finnishSaveOwnershipMicroRetAction:(UIButton *)sender {
    [[HelloFormManager shared] componentMapWindow];
    [PartialBest finnishSaveOwnershipMicroRetAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = PartialBest.mouseEarlier.barSceneEasy;

    
    self.view.backgroundColor = [PartialBest cursiveIcySpaWasSendColor];
    NSString *combiningLineDownChangingLower = [PartialBest socialForRenewalRainRetImage];
    if (combiningLineDownChangingLower) {
        UIImageView *sawFactCatImageView = [[UIImageView alloc] init];
        sawFactCatImageView.contentMode = UIViewContentModeScaleAspectFill;
        sawFactCatImageView.clipsToBounds = YES;
        sawFactCatImageView.layer.cornerRadius = PartialBest.mouseEarlier.barSceneEasy;
        sawFactCatImageView.layer.masksToBounds = YES;
        [sawFactCatImageView sd_setImageWithURL:[NSURL URLWithString:combiningLineDownChangingLower]];
        [self.view insertSubview:sawFactCatImageView atIndex:0];
        [sawFactCatImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        self.inferModifiersUnwindEncryptListImageView = sawFactCatImageView;
    }

    [self.view addSubview:self.nearHumanButton];
    [self.view addSubview:self.declineRawButton];
    
    CGFloat hasSize = PartialBest.mouseEarlier.countTenSelf;
    [_nearHumanButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(PartialBest.mouseEarlier.stickyVideo);
        make.size.mas_equalTo(CGSizeMake(hasSize, hasSize));
    }];
    [_declineRawButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(PartialBest.mouseEarlier.stickyVideo);
        make.right.equalTo(self.view).offset(-PartialBest.mouseEarlier.stickyVideo);
        make.size.mas_equalTo(CGSizeMake(hasSize, hasSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ownerVolumePoolZipAppliesRightFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(numberPlainDecayGradeSystolicKit:) 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([PartialBest sayHangExecSelectingPencilWaxSize]);
    }];
}


- (void)ownerVolumePoolZipAppliesRightFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect stoodBinFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [HelloFormManager shared].winGatheringWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(PartialBest.mouseEarlier.scrollsTamilStaticWasManyKit)]) {
#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 earRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((earRect.origin.y + earRect.size.height) > stoodBinFrame.origin.y) {
                CGFloat bayer = ((earRect.origin.y + earRect.size.height) - stoodBinFrame.origin.y) + 10;
                
                revoked(self);
                [UIView animateWithDuration:duration animations:^{
                    pageChild(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -bayer);
                }];
            }
        }
    }
}


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

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

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