CNLiveFoundViewController.m 1.58 KB
//
//  CNLiveFoundViewController.m
//  CNLiveServices_Example
//
//  Created by CNLive-zxw on 2019/7/23.
//  Copyright © 2019 153993236@qq.com. All rights reserved.
//

#import "CNLiveFoundViewController.h"

@interface CNLiveFoundViewController ()

@end

@implementation CNLiveFoundViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.title = @"发现";
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton *btn0 = [UIButton buttonWithType:UIButtonTypeCustom];
    btn0.frame = CGRectMake(0, 0, 100, 100);
    btn0.center = self.view.center;
    btn0.backgroundColor = [UIColor redColor];
    [btn0 setTitle:@"回调传值" forState:UIControlStateNormal];
    [btn0 addTarget:self action:@selector(testButtonClicked) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn0];

}

- (void)testButtonClicked {
    if ([self.delegate respondsToSelector:@selector(backToFoundViewControllerByName:)]) {
        [self.delegate backToFoundViewControllerByName:@"哈哈-faxian"];
    }
    UINavigationController *nav = (UINavigationController *)[UIApplication sharedApplication].delegate.window.rootViewController;
    [nav popViewControllerAnimated: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