






#import "HistoryViewController.h"

@interface HistoryViewController ()

@end

@implementation HistoryViewController

- (UIButton *)stopDrainButton
{
    if (!_stopDrainButton) {
        _stopDrainButton = [[UIButton alloc] init];
        [_stopDrainButton setTitle:HourEllipse.howSignaling.hintMillYetEqualDrivenUnlikely forState:UIControlStateNormal];
        [_stopDrainButton setTitleColor:[HourEllipse exchangesColor] forState:UIControlStateNormal];
        [_stopDrainButton addTarget:self action:@selector(overwriteWayFocusedProductsLayoutAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _stopDrainButton;
}

- (UIButton *)repeatsDogButton
{
    if (!_repeatsDogButton) {
        _repeatsDogButton = [[UIButton alloc] init];
        [_repeatsDogButton setTitle:HourEllipse.howSignaling.viewForwardSoundTrustIronTilde forState:UIControlStateNormal];
        [_repeatsDogButton setTitleColor:[HourEllipse exchangesColor] forState:UIControlStateNormal];
        [_repeatsDogButton addTarget:self action:@selector(resourcesEscapeHourlyContentsAssistantAction:) forControlEvents:UIControlEventTouchUpInside];
        _repeatsDogButton.hidden = [HourEllipse textualPointWasAmpereRearrangeOur];
    }
    return _repeatsDogButton;
}

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

- (void)resourcesEscapeHourlyContentsAssistantAction:(UIButton *)sender {
    [[CountHostManager shared] tallImperialWindow];
    [HourEllipse resourcesEscapeHourlyContentsAssistantAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [HourEllipse respondsOceanDiscardedDashSortColor];
    [self.view addSubview:self.stopDrainButton];
    [self.view addSubview:self.repeatsDogButton];
    
    CGFloat sexSize = HourEllipse.howSignaling.oneRightTool;
    [_stopDrainButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(HourEllipse.howSignaling.peakIndexes);
        make.size.mas_equalTo(CGSizeMake(sexSize, sexSize));
    }];
    [_repeatsDogButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(HourEllipse.howSignaling.peakIndexes);
        make.right.equalTo(self.view).offset(-HourEllipse.howSignaling.peakIndexes);
        make.size.mas_equalTo(CGSizeMake(sexSize, sexSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(strokeLemmaBitsActionHisAssertFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(blendWetNameAnimateKinMaker:) 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([HourEllipse followFinishingManualOutPriorExactnessSize]);
    }];
}


- (void)strokeLemmaBitsActionHisAssertFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect offPasteFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [CountHostManager shared].maxForceDarkWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(HourEllipse.howSignaling.recordingFixturePetiteRowCaseValidates)]) {
#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 capRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((capRect.origin.y + capRect.size.height) > offPasteFrame.origin.y) {
                CGFloat swipe = ((capRect.origin.y + capRect.size.height) - offPasteFrame.origin.y) + 10;
                
                moreToo(self);
                [UIView animateWithDuration:duration animations:^{
                    cursorPen(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -swipe);
                }];
            }
        }
    }
}


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

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

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