






#import "DiskSinViewController.h"

@interface DiskSinViewController ()

@end

@implementation DiskSinViewController

- (UIButton *)returnOptButton
{
    if (!_returnOptButton) {
        _returnOptButton = [[UIButton alloc] init];
        [_returnOptButton setTitle:AreStateWon.twoHoverHard.moveIgnoringSupplyPintTwistStrongest forState:UIControlStateNormal];
        [_returnOptButton setTitleColor:[AreStateWon lostGuideColor] forState:UIControlStateNormal];
        [_returnOptButton addTarget:self action:@selector(procedureSourcesRawRowFractionAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _returnOptButton;
}

- (UIButton *)fairTargetButton
{
    if (!_fairTargetButton) {
        _fairTargetButton = [[UIButton alloc] init];
        [_fairTargetButton setTitle:AreStateWon.twoHoverHard.allergyLiterAlternateAndLaunchingDrain forState:UIControlStateNormal];
        [_fairTargetButton setTitleColor:[AreStateWon lostGuideColor] forState:UIControlStateNormal];
        [_fairTargetButton addTarget:self action:@selector(sortFunctionsRearShutdownInsertionAction:) forControlEvents:UIControlEventTouchUpInside];
        _fairTargetButton.hidden = [AreStateWon cutoffPagePromiseEarTooMasters];
    }
    return _fairTargetButton;
}

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

- (void)sortFunctionsRearShutdownInsertionAction:(UIButton *)sender {
    [[LocationsManager shared] hisLargerOptWindow];
    [AreStateWon sortFunctionsRearShutdownInsertionAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [AreStateWon gatherItsTabKeysCellColor];
    [self.view addSubview:self.returnOptButton];
    [self.view addSubview:self.fairTargetButton];
    
    CGFloat netSize = AreStateWon.twoHoverHard.slightEraMax;
    [_returnOptButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(AreStateWon.twoHoverHard.agePoloBoth);
        make.size.mas_equalTo(CGSizeMake(netSize, netSize));
    }];
    [_fairTargetButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(AreStateWon.twoHoverHard.agePoloBoth);
        make.right.equalTo(self.view).offset(-AreStateWon.twoHoverHard.agePoloBoth);
        make.size.mas_equalTo(CGSizeMake(netSize, netSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(metricGuestDisparityPopRemovesSubfamilyFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(compositeSubscriptSerbianAngularReferenceDublin:) 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([AreStateWon prettySaltSubstringReleasedFoundOneSize]);
    }];
}


- (void)metricGuestDisparityPopRemovesSubfamilyFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect labelHasFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [LocationsManager shared].hasPeakThickWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(AreStateWon.twoHoverHard.manDrainSoccerSpousesPacePeriod)]) {
#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 retRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((retRect.origin.y + retRect.size.height) > labelHasFrame.origin.y) {
                CGFloat arrow = ((retRect.origin.y + retRect.size.height) - labelHasFrame.origin.y) + 10;
                
                nothing(self);
                [UIView animateWithDuration:duration animations:^{
                    niacinSpa(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -arrow);
                }];
            }
        }
    }
}


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

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

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