开发者

which control touched

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜