






#import "GeneralViewController.h"

@interface GeneralViewController ()

@end

@implementation GeneralViewController

- (UIButton *)reversingButton
{
    if (!_reversingButton) {
        _reversingButton = [[UIButton alloc] init];
        [_reversingButton setTitle:CutEightLow.licenseSmart.lowReorderKindOperationEsperantoUniform forState:UIControlStateNormal];
        [_reversingButton setTitleColor:[CutEightLow elderHairColor] forState:UIControlStateNormal];
        [_reversingButton addTarget:self action:@selector(closeKitFourBarEditorAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _reversingButton;
}

- (UIButton *)genreFinalButton
{
    if (!_genreFinalButton) {
        _genreFinalButton = [[UIButton alloc] init];
        [_genreFinalButton setTitle:CutEightLow.licenseSmart.decoderRaiseMovieUrgencyFlightTrial forState:UIControlStateNormal];
        [_genreFinalButton setTitleColor:[CutEightLow elderHairColor] forState:UIControlStateNormal];
        [_genreFinalButton addTarget:self action:@selector(sleetSpeakTopFairArmenianAction:) forControlEvents:UIControlEventTouchUpInside];
        _genreFinalButton.hidden = [CutEightLow muteTranslateAllocatedHealthCoverFifteen];
    }
    return _genreFinalButton;
}

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

- (void)sleetSpeakTopFairArmenianAction:(UIButton *)sender {
    [[UplinkDryManager shared] forkVolatileWindow];
    [CutEightLow sleetSpeakTopFairArmenianAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [CutEightLow startedPictureHexRollSiblingsColor];
    [self.view addSubview:self.reversingButton];
    [self.view addSubview:self.genreFinalButton];
    
    CGFloat minSize = CutEightLow.licenseSmart.hexWristPath;
    [_reversingButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(CutEightLow.licenseSmart.buddyTarget);
        make.size.mas_equalTo(CGSizeMake(minSize, minSize));
    }];
    [_genreFinalButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(CutEightLow.licenseSmart.buddyTarget);
        make.right.equalTo(self.view).offset(-CutEightLow.licenseSmart.buddyTarget);
        make.size.mas_equalTo(CGSizeMake(minSize, minSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(supportsWaxArcheryActionsKilometerUtilityFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(burstLogicalYouEngravedFunAngular:) 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([CutEightLow faeroeseRopeHisDarwinPlatformMathSize]);
    }];
}


- (void)supportsWaxArcheryActionsKilometerUtilityFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect writeBitFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [UplinkDryManager shared].libraryGivenWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(CutEightLow.licenseSmart.permuteTenWidthTabCreatorLanguages)]) {
#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 eggRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((eggRect.origin.y + eggRect.size.height) > writeBitFrame.origin.y) {
                CGFloat serif = ((eggRect.origin.y + eggRect.size.height) - writeBitFrame.origin.y) + 10;
                
                friends(self);
                [UIView animateWithDuration:duration animations:^{
                    telephoto(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -serif);
                }];
            }
        }
    }
}


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

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

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