






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

@interface TwoMarkViewController ()

@end

@implementation TwoMarkViewController

- (UIButton *)protocolsButton
{
    if (!_protocolsButton) {
        _protocolsButton = [[UIButton alloc] init];
        [_protocolsButton setTitle:DistantEach.whoFrenchMin.balticCarPrepRussianSlovakInserted forState:UIControlStateNormal];
        [_protocolsButton setTitleColor:[DistantEach visitDeepColor] forState:UIControlStateNormal];
        [_protocolsButton addTarget:self action:@selector(splitMajorGloballyPositionsHandlingAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _protocolsButton;
}

- (UIButton *)anyDisplayButton
{
    if (!_anyDisplayButton) {
        _anyDisplayButton = [[UIButton alloc] init];
        [_anyDisplayButton setTitle:DistantEach.whoFrenchMin.minimumIssuerDetailedWireStandEye forState:UIControlStateNormal];
        [_anyDisplayButton setTitleColor:[DistantEach visitDeepColor] forState:UIControlStateNormal];
        [_anyDisplayButton addTarget:self action:@selector(trainerAboveBinTerabytesFootballAction:) forControlEvents:UIControlEventTouchUpInside];
        _anyDisplayButton.hidden = [DistantEach meterChangeDogStriationDescribesSub];
    }
    return _anyDisplayButton;
}

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

- (void)trainerAboveBinTerabytesFootballAction:(UIButton *)sender {
    [[MatrixFixManager shared] stairDesktopWindow];
    [DistantEach trainerAboveBinTerabytesFootballAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = DistantEach.whoFrenchMin.catPointEach;

    
    self.view.backgroundColor = [DistantEach emailContentThickFilmClearedColor];
    NSString *esperantoBehaveOrderedComposerProducts = [DistantEach beforeDeliveredBreakBlockerShutterImage];
    if (esperantoBehaveOrderedComposerProducts) {
        UIImageView *manyLongerImageView = [[UIImageView alloc] init];
        manyLongerImageView.contentMode = UIViewContentModeScaleAspectFill;
        manyLongerImageView.clipsToBounds = YES;
        manyLongerImageView.layer.cornerRadius = DistantEach.whoFrenchMin.catPointEach;
        manyLongerImageView.layer.masksToBounds = YES;
        [manyLongerImageView sd_setImageWithURL:[NSURL URLWithString:esperantoBehaveOrderedComposerProducts]];
        [self.view insertSubview:manyLongerImageView atIndex:0];
        [manyLongerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        self.raceAddressSmallerMillionSharpnessImageView = manyLongerImageView;
    }

    [self.view addSubview:self.protocolsButton];
    [self.view addSubview:self.anyDisplayButton];
    
    CGFloat pubSize = DistantEach.whoFrenchMin.pipeFlexible;
    [_protocolsButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(DistantEach.whoFrenchMin.scoreTriple);
        make.size.mas_equalTo(CGSizeMake(pubSize, pubSize));
    }];
    [_anyDisplayButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(DistantEach.whoFrenchMin.scoreTriple);
        make.right.equalTo(self.view).offset(-DistantEach.whoFrenchMin.scoreTriple);
        make.size.mas_equalTo(CGSizeMake(pubSize, pubSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(phaseBecomeEchoPenKernelIncludesFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(highlightExportSoftballInsertedAreYard:) 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([DistantEach indexedIcelandicEarNecessaryDictationSixteenSize]);
    }];
}


- (void)phaseBecomeEchoPenKernelIncludesFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect contentsFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [MatrixFixManager shared].lawStylisticWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(DistantEach.whoFrenchMin.diphthongPlayableSeasonPreservedPopLibraries)]) {
#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 whoRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((whoRect.origin.y + whoRect.size.height) > contentsFrame.origin.y) {
                CGFloat radix = ((whoRect.origin.y + whoRect.size.height) - contentsFrame.origin.y) + 10;
                
                ourCost(self);
                [UIView animateWithDuration:duration animations:^{
                    deviceBed(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -radix);
                }];
            }
        }
    }
}


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

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

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