






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

@interface CatDashViewController ()

@end

@implementation CatDashViewController

- (UIButton *)locationsButton
{
    if (!_locationsButton) {
        _locationsButton = [[UIButton alloc] init];
        [_locationsButton setTitle:HexDiscrete.shelfTenSide.feedSinProgressScrollPacketsInsert forState:UIControlStateNormal];
        [_locationsButton setTitleColor:[HexDiscrete thinClaimColor] forState:UIControlStateNormal];
        [_locationsButton addTarget:self action:@selector(opaqueDiphthongSchemeMaleForbiddenAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _locationsButton;
}

- (UIButton *)bitSlashesButton
{
    if (!_bitSlashesButton) {
        _bitSlashesButton = [[UIButton alloc] init];
        [_bitSlashesButton setTitle:HexDiscrete.shelfTenSide.reduceCharPanReceiptPatternObscures forState:UIControlStateNormal];
        [_bitSlashesButton setTitleColor:[HexDiscrete thinClaimColor] forState:UIControlStateNormal];
        [_bitSlashesButton addTarget:self action:@selector(armCollapsedDegreesChallengeGradientAction:) forControlEvents:UIControlEventTouchUpInside];
        _bitSlashesButton.hidden = [HexDiscrete areSucceedPanLowSoloThe];
    }
    return _bitSlashesButton;
}

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

- (void)armCollapsedDegreesChallengeGradientAction:(UIButton *)sender {
    [[SoloSlantManager shared] handshakeSpaWindow];
    [HexDiscrete armCollapsedDegreesChallengeGradientAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = HexDiscrete.shelfTenSide.dueMetalLink;

    
    self.view.backgroundColor = [HexDiscrete problemBroadcastBitRouteYearColor];
    NSString *advancesGuestInsideActionsEast = [HexDiscrete iodineJustCapturedFairPickImage];
    if (advancesGuestInsideActionsEast) {
        UIImageView *restReviewImageView = [[UIImageView alloc] init];
        restReviewImageView.contentMode = UIViewContentModeScaleAspectFill;
        restReviewImageView.clipsToBounds = YES;
        restReviewImageView.layer.cornerRadius = HexDiscrete.shelfTenSide.dueMetalLink;
        restReviewImageView.layer.masksToBounds = YES;
        [restReviewImageView sd_setImageWithURL:[NSURL URLWithString:advancesGuestInsideActionsEast]];
        [self.view insertSubview:restReviewImageView atIndex:0];
        [restReviewImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        self.pairFindBrowsingNearbyModerateImageView = restReviewImageView;
    }

    [self.view addSubview:self.locationsButton];
    [self.view addSubview:self.bitSlashesButton];
    
    CGFloat trySize = HexDiscrete.shelfTenSide.milePauseBad;
    [_locationsButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(HexDiscrete.shelfTenSide.subLiterFix);
        make.size.mas_equalTo(CGSizeMake(trySize, trySize));
    }];
    [_bitSlashesButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(HexDiscrete.shelfTenSide.subLiterFix);
        make.right.equalTo(self.view).offset(-HexDiscrete.shelfTenSide.subLiterFix);
        make.size.mas_equalTo(CGSizeMake(trySize, trySize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(addCourseModifyReasonPolicyKilogramsFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onlyHelloYetHellmanFeedbackDry:) 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([HexDiscrete grantingMultipleImmediateExpandStrokingSockSize]);
    }];
}


- (void)addCourseModifyReasonPolicyKilogramsFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect birthDidFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [SoloSlantManager shared].foggyTiedDueWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(HexDiscrete.shelfTenSide.restartAppliesIndexingBlusteryEncipherRegistry)]) {
#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 areRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((areRect.origin.y + areRect.size.height) > birthDidFrame.origin.y) {
                CGFloat exits = ((areRect.origin.y + areRect.size.height) - birthDidFrame.origin.y) + 10;
                
                lazyFax(self);
                [UIView animateWithDuration:duration animations:^{
                    extendCat(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -exits);
                }];
            }
        }
    }
}


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

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

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