- (void)touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event{
//如果touch到closeButton的區域,就觸發closeButton
CGPoint pt = [[touches anyObject]locationInView:self.view];
if (pt.x>closeButton.frame.origin.x &&
pt.x<closeButton.frame.origin.x+closeButton.frame.size.width &&
pt.y>closeButton.frame.origin.y &&
pt.y<closeButton.frame.origin.y+closeButton.frame.size.height)
{
[self closeButtonTapped:touches];
}
}
沒有留言:
張貼留言