I used the codes below to detect touch on the object
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSArray *allTouches = [touches allObjects];
for (UITouch *touch in allTouches)
{
NSLog(@"TOUCH DETECT");
}
}
but it is not triggered
Welcome any comment
What kind of object?
touchesBegan:withEvent:is only called for UIResponder subclasses.Also, if it’s a UIView, make sure
userInteractionEnabledis YES.