






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

@interface BackSunViewController ()

@end

@implementation BackSunViewController

- (UIButton *)markWristButton
{
    if (!_markWristButton) {
        _markWristButton = [[UIButton alloc] init];
        [_markWristButton setTitle:RuleListCut.coloredDraft.eightRenewedIntentsOnlyArtPatch forState:UIControlStateNormal];
        [_markWristButton setTitleColor:[RuleListCut dayMarginColor] forState:UIControlStateNormal];
        [_markWristButton addTarget:self action:@selector(indentSlightRowBandAboutAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _markWristButton;
}

- (UIButton *)cascadeNotButton
{
    if (!_cascadeNotButton) {
        _cascadeNotButton = [[UIButton alloc] init];
        [_cascadeNotButton setTitle:RuleListCut.coloredDraft.impliedAirCookieManSlantToggle forState:UIControlStateNormal];
        [_cascadeNotButton setTitleColor:[RuleListCut dayMarginColor] forState:UIControlStateNormal];
        [_cascadeNotButton addTarget:self action:@selector(ovulationSlabSecretLemmaHebrewAction:) forControlEvents:UIControlEventTouchUpInside];
        _cascadeNotButton.hidden = [RuleListCut campaignHexMouseLowerAnyRun];
    }
    return _cascadeNotButton;
}

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

- (void)ovulationSlabSecretLemmaHebrewAction:(UIButton *)sender {
    [[PopParserManager shared] quitTwistJobWindow];
    [RuleListCut ovulationSlabSecretLemmaHebrewAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = RuleListCut.coloredDraft.malteseClamp;

    
    self.view.backgroundColor = [RuleListCut genreEggWetStillDescentColor];
    NSString *temporaryStereoRedHelpersOutput = [RuleListCut schedulerFlowAxialLittleWaxImage];
    if (temporaryStereoRedHelpersOutput) {
        UIImageView *itsSoftSobImageView = [[UIImageView alloc] init];
        itsSoftSobImageView.contentMode = UIViewContentModeScaleAspectFill;
        itsSoftSobImageView.clipsToBounds = YES;
        itsSoftSobImageView.layer.cornerRadius = RuleListCut.coloredDraft.malteseClamp;
        itsSoftSobImageView.layer.masksToBounds = YES;
        [itsSoftSobImageView sd_setImageWithURL:[NSURL URLWithString:temporaryStereoRedHelpersOutput]];
        [self.view insertSubview:itsSoftSobImageView atIndex:0];
        [itsSoftSobImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        self.dominantClickedIntegersBusBeganImageView = itsSoftSobImageView;
    }

    [self.view addSubview:self.markWristButton];
    [self.view addSubview:self.cascadeNotButton];
    
    CGFloat seeSize = RuleListCut.coloredDraft.capShakeSlow;
    [_markWristButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(RuleListCut.coloredDraft.asleepScene);
        make.size.mas_equalTo(CGSizeMake(seeSize, seeSize));
    }];
    [_cascadeNotButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(RuleListCut.coloredDraft.asleepScene);
        make.right.equalTo(self.view).offset(-RuleListCut.coloredDraft.asleepScene);
        make.size.mas_equalTo(CGSizeMake(seeSize, seeSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(insidePutReliableLacrosseUppercaseRebusFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reportingDirectlyWeekdayFlushSettingCancels:) 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([RuleListCut insertedPickEnumerateDownloadBusHandshakeSize]);
    }];
}


- (void)insidePutReliableLacrosseUppercaseRebusFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect subEnterFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [PopParserManager shared].draftEarBookWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(RuleListCut.coloredDraft.heightShearStreamsNibblesFitnessSecure)]) {
#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 askRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((askRect.origin.y + askRect.size.height) > subEnterFrame.origin.y) {
                CGFloat thumb = ((askRect.origin.y + askRect.size.height) - subEnterFrame.origin.y) + 10;
                
                fourJob(self);
                [UIView animateWithDuration:duration animations:^{
                    maskLocal(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -thumb);
                }];
            }
        }
    }
}


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

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

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