//
//  AuthenticationReviewController.m
//  KKCivilAd
//
//  Created by 雷俊博 on 2019/12/11.
//  Copyright © 2019 雷俊博. All rights reserved.
//

#import "AuthenticationReviewController.h"

#import "DistrictAuthenticationPersonalInfoController.h"

@interface AuthenticationReviewController ()

@end

@implementation AuthenticationReviewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    //禁止手势返回
       id traget = self.navigationController.interactivePopGestureRecognizer.delegate;
       UIPanGestureRecognizer * pan = [[UIPanGestureRecognizer alloc]initWithTarget:traget action:nil];
       [self.view addGestureRecognizer:pan];
    
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    }
    
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];

    // 开启返回手势
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    }
    
}

#pragma mark - event response
- (IBAction)btnClick:(UIButton *)sender {
    
    for (UIViewController*vc in self.navigationController.viewControllers) {
        if ([vc isKindOfClass:[DistrictAuthenticationPersonalInfoController class]]) {
            DistrictAuthenticationPersonalInfoController*dVC = (DistrictAuthenticationPersonalInfoController *)vc;
            [dVC cleartText];
            break;
        }
    }
    
    [self.navigationController popToViewController:self.navigationController.viewControllers[1] animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
