






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

@interface CarPeerViewController ()

@end

@implementation CarPeerViewController

- (UIButton *)execBrownButton
{
    if (!_execBrownButton) {
        _execBrownButton = [[UIButton alloc] init];
        [_execBrownButton setTitle:RowAirFloor.loveHitOrder.updateSmoothingLanguagesMicroUnchangedLexical forState:UIControlStateNormal];
        [_execBrownButton setTitleColor:[RowAirFloor draftPongColor] forState:UIControlStateNormal];
        [_execBrownButton addTarget:self action:@selector(panContentOptProductsGroupedAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _execBrownButton;
}

- (UIButton *)autoCarSexButton
{
    if (!_autoCarSexButton) {
        _autoCarSexButton = [[UIButton alloc] init];
        [_autoCarSexButton setTitle:RowAirFloor.loveHitOrder.indoorPacketsChargingSexAgeResonant forState:UIControlStateNormal];
        [_autoCarSexButton setTitleColor:[RowAirFloor draftPongColor] forState:UIControlStateNormal];
        [_autoCarSexButton addTarget:self action:@selector(capacityAltitudeCountingSafetyBadAction:) forControlEvents:UIControlEventTouchUpInside];
        _autoCarSexButton.hidden = [RowAirFloor lostGetItsDaughtersLoopBackup];
    }
    return _autoCarSexButton;
}

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

- (void)capacityAltitudeCountingSafetyBadAction:(UIButton *)sender {
    [[HangOrderManager shared] waxMustGreenWindow];
    [RowAirFloor capacityAltitudeCountingSafetyBadAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = RowAirFloor.loveHitOrder.timeCreation;

    
    self.view.backgroundColor = [RowAirFloor trialSortingChainDevicesRetainColor];
    NSString *manLuminanceEnableLargeMessaging = [RowAirFloor layerMantissaLoudSchedulerIrishImage];
    if (manLuminanceEnableLargeMessaging) {
        UIImageView *tooDetectsImageView = [[UIImageView alloc] init];
        tooDetectsImageView.contentMode = UIViewContentModeScaleAspectFill;
        tooDetectsImageView.clipsToBounds = YES;
        tooDetectsImageView.layer.cornerRadius = RowAirFloor.loveHitOrder.timeCreation;
        tooDetectsImageView.layer.masksToBounds = YES;
        [tooDetectsImageView sd_setImageWithURL:[NSURL URLWithString:manLuminanceEnableLargeMessaging]];
        [self.view insertSubview:tooDetectsImageView atIndex:0];
        [tooDetectsImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        self.genderBaselinesBusyRationalLowercaseImageView = tooDetectsImageView;
    }

    [self.view addSubview:self.execBrownButton];
    [self.view addSubview:self.autoCarSexButton];
    
    CGFloat fixSize = RowAirFloor.loveHitOrder.coachedSleep;
    [_execBrownButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(RowAirFloor.loveHitOrder.reactorSelf);
        make.size.mas_equalTo(CGSizeMake(fixSize, fixSize));
    }];
    [_autoCarSexButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(RowAirFloor.loveHitOrder.reactorSelf);
        make.right.equalTo(self.view).offset(-RowAirFloor.loveHitOrder.reactorSelf);
        make.size.mas_equalTo(CGSizeMake(fixSize, fixSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(profileTrustedForbidCompressDiscardUtilitiesFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(columnsElementHexAreCatPitch:) 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([RowAirFloor portraitsFiveItsAdverbHandTenSize]);
    }];
}


- (void)profileTrustedForbidCompressDiscardUtilitiesFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect blockYouFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [HangOrderManager shared].outputsCauseWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(RowAirFloor.loveHitOrder.liftBoundSentencesPlatformRoleForbid)]) {
#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 oneRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((oneRect.origin.y + oneRect.size.height) > blockYouFrame.origin.y) {
                CGFloat trial = ((oneRect.origin.y + oneRect.size.height) - blockYouFrame.origin.y) + 10;
                
                notDays(self);
                [UIView animateWithDuration:duration animations:^{
                    schemeCup(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -trial);
                }];
            }
        }
    }
}


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

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

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