开发者

which control touched

开发者 https://www.devze.com 2023-01-19 00:15 出处:网络
In below code how can i understand that which control touched?(imagine tha开发者_运维问答t exist button1,label1,.. on view)

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消