






#import "PubStepViewController.h"

@interface PubStepViewController ()

@end

@implementation PubStepViewController

- (UIButton *)valueRingButton
{
    if (!_valueRingButton) {
        _valueRingButton = [[UIButton alloc] init];
        [_valueRingButton setTitle:MusicLowPen.artBehaveMay.treeOlympusDropCanOddScanner forState:UIControlStateNormal];
        [_valueRingButton setTitleColor:[MusicLowPen divideOldColor] forState:UIControlStateNormal];
        [_valueRingButton addTarget:self action:@selector(filenamesUnfocusedRotateFurlongsHallAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _valueRingButton;
}

- (UIButton *)endTaggingButton
{
    if (!_endTaggingButton) {
        _endTaggingButton = [[UIButton alloc] init];
        [_endTaggingButton setTitle:MusicLowPen.artBehaveMay.gigahertzSolidReadableCroppingDraftDue forState:UIControlStateNormal];
        [_endTaggingButton setTitleColor:[MusicLowPen divideOldColor] forState:UIControlStateNormal];
        [_endTaggingButton addTarget:self action:@selector(speedShortHeaderDistantInviteAction:) forControlEvents:UIControlEventTouchUpInside];
        _endTaggingButton.hidden = [MusicLowPen parsecsShortcutsYoungerRestoringStartWax];
    }
    return _endTaggingButton;
}

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

- (void)speedShortHeaderDistantInviteAction:(UIButton *)sender {
    [[BigCustomManager shared] waxNativeYetWindow];
    [MusicLowPen speedShortHeaderDistantInviteAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = 2;
    self.view.backgroundColor = [MusicLowPen providesSubSubstringAnonymousPlainColor];
    [self.view addSubview:self.valueRingButton];
    [self.view addSubview:self.endTaggingButton];
    
    CGFloat maxSize = MusicLowPen.artBehaveMay.pinkHeadline;
    [_valueRingButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(MusicLowPen.artBehaveMay.memoryShape);
        make.size.mas_equalTo(CGSizeMake(maxSize, maxSize));
    }];
    [_endTaggingButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(MusicLowPen.artBehaveMay.memoryShape);
        make.right.equalTo(self.view).offset(-MusicLowPen.artBehaveMay.memoryShape);
        make.size.mas_equalTo(CGSizeMake(maxSize, maxSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(grayCropEndNoteConflictsConvertFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(adjustingInsertFeatPoloPostTable:) 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([MusicLowPen archivedSlabDensityDepartureThirdDocumentsSize]);
    }];
}


- (void)grayCropEndNoteConflictsConvertFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect basalTooFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [BigCustomManager shared].performerRedWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(MusicLowPen.artBehaveMay.limitWinFactoriesLigaturesRemainderBrown)]) {
#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 tooRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((tooRect.origin.y + tooRect.size.height) > basalTooFrame.origin.y) {
                CGFloat bleed = ((tooRect.origin.y + tooRect.size.height) - basalTooFrame.origin.y) + 10;
                
                failing(self);
                [UIView animateWithDuration:duration animations:^{
                    stereoAge(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -bleed);
                }];
            }
        }
    }
}


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

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

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