






#import "DrizzleViewController.h"

@interface DrizzleViewController ()

@end

@implementation DrizzleViewController

- (UIButton *)greatRainButton
{
    if (!_greatRainButton) {
        _greatRainButton = [[UIButton alloc] init];
        [_greatRainButton setTitle:PinMovement.cupFormatSun.figureRealmQualifierDrySynthesisSomali forState:UIControlStateNormal];
        [_greatRainButton setTitleColor:[PinMovement authorSunColor] forState:UIControlStateNormal];
        [_greatRainButton addTarget:self action:@selector(spaceBehaviorsBeforeScrollEnclosingAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _greatRainButton;
}

- (UIButton *)bagDesktopButton
{
    if (!_bagDesktopButton) {
        _bagDesktopButton = [[UIButton alloc] init];
        [_bagDesktopButton setTitle:PinMovement.cupFormatSun.contextEnergyScalingEmptyHueTail forState:UIControlStateNormal];
        [_bagDesktopButton setTitleColor:[PinMovement authorSunColor] forState:UIControlStateNormal];
        [_bagDesktopButton addTarget:self action:@selector(paletteExtrasSeedTipIssuerAction:) forControlEvents:UIControlEventTouchUpInside];
        _bagDesktopButton.hidden = [PinMovement separatedBarLatencyFallbackOfferUse];
    }
    return _bagDesktopButton;
}

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

- (void)paletteExtrasSeedTipIssuerAction:(UIButton *)sender {
    [[UnpluggedManager shared] policyHitOurWindow];
    [PinMovement paletteExtrasSeedTipIssuerAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [PinMovement recoveredDiscardsLargestQuantityAxialColor];
    [self.view addSubview:self.greatRainButton];
    [self.view addSubview:self.bagDesktopButton];
    
    CGFloat ownSize = PinMovement.cupFormatSun.squashCanIts;
    [_greatRainButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(PinMovement.cupFormatSun.foundTipCar);
        make.size.mas_equalTo(CGSizeMake(ownSize, ownSize));
    }];
    [_bagDesktopButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(PinMovement.cupFormatSun.foundTipCar);
        make.right.equalTo(self.view).offset(-PinMovement.cupFormatSun.foundTipCar);
        make.size.mas_equalTo(CGSizeMake(ownSize, ownSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(cycleSmallerScanningNearHitFunFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(faxShareGreatMajorPositionContained:) 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([PinMovement iconIgnoreResultingTrademarkNecessaryIndentSize]);
    }];
}


- (void)cycleSmallerScanningNearHitFunFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect queryingFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [UnpluggedManager shared].gainMusicMayWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(PinMovement.cupFormatSun.protocolsWasSlideOperateLegibleSock)]) {
#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 sheRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((sheRect.origin.y + sheRect.size.height) > queryingFrame.origin.y) {
                CGFloat sheet = ((sheRect.origin.y + sheRect.size.height) - queryingFrame.origin.y) + 10;
                
                fetched(self);
                [UIView animateWithDuration:duration animations:^{
                    stereoSay(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -sheet);
                }];
            }
        }
    }
}


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

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

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