






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

@interface TrustedViewController ()

@end

@implementation TrustedViewController

- (UIButton *)sunStaticButton
{
    if (!_sunStaticButton) {
        _sunStaticButton = [[UIButton alloc] init];
        [_sunStaticButton setTitle:WinSubAbove.swipeFlagDay.sensitiveKitGuestTagCheckingAssertion forState:UIControlStateNormal];
        [_sunStaticButton setTitleColor:[WinSubAbove areMinuteColor] forState:UIControlStateNormal];
        [_sunStaticButton addTarget:self action:@selector(desiredDisableShadowMagnitudeEsperantoAction:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _sunStaticButton;
}

- (UIButton *)sunTreeIllButton
{
    if (!_sunTreeIllButton) {
        _sunTreeIllButton = [[UIButton alloc] init];
        [_sunTreeIllButton setTitle:WinSubAbove.swipeFlagDay.singleSpringMountedInvitedReductionRefreshed forState:UIControlStateNormal];
        [_sunTreeIllButton setTitleColor:[WinSubAbove areMinuteColor] forState:UIControlStateNormal];
        [_sunTreeIllButton addTarget:self action:@selector(fitGlucoseReclaimHasEndpointAction:) forControlEvents:UIControlEventTouchUpInside];
        _sunTreeIllButton.hidden = [WinSubAbove parentalSelfBlueTriggerLeftHash];
    }
    return _sunTreeIllButton;
}

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

- (void)fitGlucoseReclaimHasEndpointAction:(UIButton *)sender {
    [[AutoIntroManager shared] fullHertzKeyWindow];
    [WinSubAbove fitGlucoseReclaimHasEndpointAction];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.view.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    self.view.layer.cornerRadius = WinSubAbove.swipeFlagDay.zipCacheEnds;

    
    self.view.backgroundColor = [WinSubAbove parameterReachableSegmentsGaspFeatColor];
    NSString *wordVoiceSettingTeamImmediate = [WinSubAbove batchAgeHangDueCroatianImage];
    if (wordVoiceSettingTeamImmediate) {
        UIImageView *failUpsideImageView = [[UIImageView alloc] init];
        failUpsideImageView.contentMode = UIViewContentModeScaleAspectFill;
        failUpsideImageView.clipsToBounds = YES;
        failUpsideImageView.layer.cornerRadius = WinSubAbove.swipeFlagDay.zipCacheEnds;
        failUpsideImageView.layer.masksToBounds = YES;
        [failUpsideImageView sd_setImageWithURL:[NSURL URLWithString:wordVoiceSettingTeamImmediate]];
        [self.view insertSubview:failUpsideImageView atIndex:0];
        [failUpsideImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.equalTo(self.view);
        }];
        self.acceptingReportInterAirBengaliImageView = failUpsideImageView;
    }

    [self.view addSubview:self.sunStaticButton];
    [self.view addSubview:self.sunTreeIllButton];
    
    CGFloat cutSize = WinSubAbove.swipeFlagDay.hangWaistBox;
    [_sunStaticButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.equalTo(self.view).offset(WinSubAbove.swipeFlagDay.peakGrammar);
        make.size.mas_equalTo(CGSizeMake(cutSize, cutSize));
    }];
    [_sunTreeIllButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).offset(WinSubAbove.swipeFlagDay.peakGrammar);
        make.right.equalTo(self.view).offset(-WinSubAbove.swipeFlagDay.peakGrammar);
        make.size.mas_equalTo(CGSizeMake(cutSize, cutSize));
    }];
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(incrementKeyboardTenRoundTipFilenameFrame:) name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(phaseCornersTrainingTrialAchievedDatabase:) 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([WinSubAbove loopsCanBlinkConcertCupScalingSize]);
    }];
}


- (void)incrementKeyboardTenRoundTipFilenameFrame:(NSNotification *)notification {
    
    CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue];
    
    
    CGRect priorityFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
    
    UIWindow *keyWindow = [AutoIntroManager shared].drySlightBagWindow;
    if (![keyWindow isMemberOfClass:NSClassFromString(WinSubAbove.swipeFlagDay.programMicroReverseDropCourseEmail)]) {
#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 subRect = [keyWindow convertRect:firstResponder.frame fromView:firstResponder.superview];
            
            if ((subRect.origin.y + subRect.size.height) > priorityFrame.origin.y) {
                CGFloat pinch = ((subRect.origin.y + subRect.size.height) - priorityFrame.origin.y) + 10;
                
                undoAdd(self);
                [UIView animateWithDuration:duration animations:^{
                    certSlide(self);
                    self.navigationController.view.transform = CGAffineTransformMakeTranslation(0, -pinch);
                }];
            }
        }
    }
}


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

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

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