CNLiveFoundViewController.m
1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// 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