今天项目需要有个弹出界面,需要点击空白处可以关闭view,发现vc自带有个方法:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)eventv
{
[self dismissViewControllerAnimated:YES completion:nil];
}
只要把
dismissViewControllerAnimated 这个方法放进去就可以了!
今天项目需要有个弹出界面,需要点击空白处可以关闭view,发现vc自带有个方法:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)eventv
{
[self dismissViewControllerAnimated:YES completion:nil];
}
dismissViewControllerAnimated 这个方法放进去就可以了!