In below code how can i understand that which control touched?(imagine that exist button1,label1,.. on view)
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
}
In below code how can i understand that which control touched?(imagine that 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.