ios--判断是否touch了某个View(winningView)

来源:互联网 发布:数控编程软件手机版 编辑:程序博客网 时间:2024/06/07 12:32

判断是否touch了某个View(winningView):

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{    UITouch *touch = [touches anyObject];    CGPoint pt = [touch locationInView:self.view];    //点击其他地方消失    if (!CGRectContainsPoint([self.winningView frame], pt)) {        //to-do    }}


1 0