if you add the addChildViewController sub-viewController, there is still no response
< hr >- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(50, 200, 60, 60)];
[btn setTitle:@"" forState:UIControlStateNormal];
[btn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
[btn setBackgroundColor:[UIColor blackColor]];
[self.view addSubview:btn];
[self addChildViewController:self.imgVC];
}
- (void)btnClick{
NSLog(@"");
}
//
- (addImgVC *)imgVC{
if (!_imgVC) {
_imgVC = [[addImgVC alloc]init];
[_imgVC.view setFrame:CGRectMake(0, 50, 375, 62)];
[self.view addSubview:_imgVC.view];
}
return _imgVC;
}