In below code how can i understand that which control touched?(imagine tha开发者_运维问答t exist button1,label1,.. on view)
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
}
Check the view property on the touch object. From the documentation:
The value of the property is the view object in which the touch originally occurred.
精彩评论