






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

@interface AddWideViewController ()

@end

@implementation AddWideViewController

- (UIButton *)truncatesButton
{
    if (!_truncatesButton) {
        _truncatesButton = [[UIButton alloc] init];
        [_truncatesButton setTitle:PriorEarSee.netListPhoto.serialBreakMinimumPreservedDeferringSeason forState:UIControlStateNormal];
        [_truncatesButton setTitleColor:[PriorEarSee collectorColor] forState:UIControlStateNormal];
        [_truncatesButton addTarget:self action:@selector(universalArmSpecifiedSlopeFitAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _truncatesButton;
}

- (UIButton *)logAddTintButton
{
    if (!_logAddTintButton) {
        _logAddTintButton = [[UIButton alloc] init];
        [_logAddTintButton setTitle:PriorEarSee.netListPhoto.mismatchVoiceRegionsInstantCyrillicPrevious forState:UIControlStateNormal];
        [_logAddTintButton setTitleColor:[PriorEarSee collectorColor] forState:UIControlStateNormal];
        [_logAddTintButton addTarget:self action:@selector(talkBeaconsWayZoneStandAction:) forControlEvents:UIControlEventTouchUpInside];
        _logAddTintButton.hidden = [PriorEarSee mongolianFlattenMillProfileAdvancedBreak];
    }
    return _logAddTintButton;
}

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

- (void)talkBeaconsWayZoneStandAction:(UIButton *)sender {
    [[WeekChainManager shared] twoStableWinWindow];
    [PriorEarSee talkBeaconsWayZoneStandAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = PriorEarSee.netListPhoto.ownChromaToo;

    
    self.view.backgroundColor = [PriorEarSee keysRetryHalfDuplexSpacingColor];
    NSString *displayScatteredEstablishMalayStarting = [PriorEarSee adjustingTexturedPreventProximityLaunchingImage];
    if (displayScatteredEstablishMalayStarting) {
        UIImageView *coverCauseImageView = [[UIImageView alloc] init];
        coverCauseImageView.contentMode = UIViewContentModeScaleAspectFill;
        coverCauseImageView.clipsToBounds = YES;
        coverCauseImageView.layer.cornerRadius = PriorEarSee.netListPhoto.ownChromaToo;
        coverCauseImageView.layer.masksToBounds = YES;
        [coverCauseImageView sd_setImageWithURL:[NSURL URLWithString:displayScatteredEstablishMalayStarting]];
        [self.view insertSubview:coverCauseImageView atIndex:0];
        [coverCauseImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        self.grantingKirghizEmbeddedFeetNineteenImageView = coverCauseImageView;
    }

    [self.view addSubview:self.truncatesButton];
    [self.view addSubview:self.logAddTintButton];
    
    CGFloat eggSize = PriorEarSee.netListPhoto.hintRetTrait;
    [_truncatesButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(PriorEarSee.netListPhoto.verticalHer);
        make.size.mas_equalTo(CGSizeMake(eggSize, eggSize));
    }];
    [_logAddTintButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(PriorEarSee.netListPhoto.verticalHer);
        make.right.equalTo(self.view).offset(-PriorEarSee.netListPhoto.verticalHer);
        make.size.mas_equalTo(CGSizeMake(eggSize, eggSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(arrangerEyeAskEffectMetabolicYouFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(incrementCupDescribePatientAbsoluteOpt:) 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([PriorEarSee batteryRectifiedBridgeSpellSpectralPacketSize]);
    }];
}


- (void)arrangerEyeAskEffectMetabolicYouFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect selectedFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [WeekChainManager shared].licenseCoastWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(PriorEarSee.netListPhoto.activatedFileHandoverNextHandshakeKit)]) {
#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 areRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((areRect.origin.y + areRect.size.height) > selectedFrame.origin.y) {
                CGFloat glyph = ((areRect.origin.y + areRect.size.height) - selectedFrame.origin.y) + 10;
                
                partial(self);
                [UIView animateWithDuration:duration animations:^{
                    italicLaw(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -glyph);
                }];
            }
        }
    }
}


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

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

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