






#import "WillZipViewController.h"

@interface WillZipViewController ()

@end

@implementation WillZipViewController

- (UIButton *)barFusionButton
{
    if (!_barFusionButton) {
        _barFusionButton = [[UIButton alloc] init];
        [_barFusionButton setTitle:HisGeometry.sinkIcyLeaky.titleSubscriptAutoAuthorUppercaseHighest forState:UIControlStateNormal];
        [_barFusionButton setTitleColor:[HisGeometry lawStylusColor] forState:UIControlStateNormal];
        [_barFusionButton addTarget:self action:@selector(factoredQuotationInsetChangingCarAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _barFusionButton;
}

- (UIButton *)magicPieceButton
{
    if (!_magicPieceButton) {
        _magicPieceButton = [[UIButton alloc] init];
        [_magicPieceButton setTitle:HisGeometry.sinkIcyLeaky.sumReversedYetFavoritesCriticalCar forState:UIControlStateNormal];
        [_magicPieceButton setTitleColor:[HisGeometry lawStylusColor] forState:UIControlStateNormal];
        [_magicPieceButton addTarget:self action:@selector(lettersParserGivenClimbingDisableAction:) forControlEvents:UIControlEventTouchUpInside];
        _magicPieceButton.hidden = [HisGeometry hourCombineRefusedNetItsOpacity];
    }
    return _magicPieceButton;
}

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

- (void)lettersParserGivenClimbingDisableAction:(UIButton *)sender {
    [[FarEntityManager shared] aloneWalkingWindow];
    [HisGeometry lettersParserGivenClimbingDisableAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [HisGeometry paletteSurrogateNaturalGesturesDenyColor];
    [self.view addSubview:self.barFusionButton];
    [self.view addSubview:self.magicPieceButton];
    
    CGFloat penSize = HisGeometry.sinkIcyLeaky.musicLookFit;
    [_barFusionButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(HisGeometry.sinkIcyLeaky.cityAdvised);
        make.size.mas_equalTo(CGSizeMake(penSize, penSize));
    }];
    [_magicPieceButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(HisGeometry.sinkIcyLeaky.cityAdvised);
        make.right.equalTo(self.view).offset(-HisGeometry.sinkIcyLeaky.cityAdvised);
        make.size.mas_equalTo(CGSizeMake(penSize, penSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(artsCaptureLostChineseOverCorruptFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(armPopIssuerWidthStillPredicted:) 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([HisGeometry genderAmbienceSlopeSixPhaseOrderSize]);
    }];
}


- (void)artsCaptureLostChineseOverCorruptFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect optionalFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [FarEntityManager shared].joinProducesWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(HisGeometry.sinkIcyLeaky.artworkPriorValidityPluralGrayPassively)]) {
#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 bitRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((bitRect.origin.y + bitRect.size.height) > optionalFrame.origin.y) {
                CGFloat touch = ((bitRect.origin.y + bitRect.size.height) - optionalFrame.origin.y) + 10;
                
                waxReal(self);
                [UIView animateWithDuration:duration animations:^{
                    caseStrip(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -touch);
                }];
            }
        }
    }
}


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

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

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