響應(yīng)時(shí)間透過某個視圖點(diǎn)擊下面的視圖:
在上層視圖中加入下面的代碼
///判斷點(diǎn)的區(qū)域拧揽,在當(dāng)前視圖中的子視圖有響應(yīng)時(shí)間就返回響應(yīng)視圖淤袜,沒有就返回nil衰伯,將手勢傳遞到下層視圖
///判斷手勢
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
{
if (CGRectContainsPoint(self.meunButton.frame, point)) {
return self.meunButton;
}else if (CGRectContainsPoint(self.homeButton.frame, point)){
return self.homeButton;
}else if (CGRectContainsPoint(self.currentLocation.frame, point)){
return self.currentLocation;
}else if (CGRectContainsPoint(self.organizationButton.frame, point)){
return self.organizationButton;
}else if (CGRectContainsPoint(self.activityButton.frame, point)){
return self.activityButton;
}else if (CGRectContainsPoint(self.positionButton.frame, point)){
return self.positionButton;
}else if (CGRectContainsPoint(self.workAddress.frame, point)){
return self.workAddress;
}
return nil;
}