开发者

How assign a touch event from a UIButton to another?

开发者 https://www.devze.com 2023-03-19 18:03 出处:网络
I have t开发者_Python百科wo UIButton. One is on top of another (think is like a sub-label). But the second UIButton block the touch from his parent. So I want to attach the Touch handling from the sub

I have t开发者_Python百科wo UIButton. One is on top of another (think is like a sub-label). But the second UIButton block the touch from his parent. So I want to attach the Touch handling from the sub-Button from his parent.

In other languages, I simply do object.event = object2.event, but I can't figure how do this in obj-c.

I try this:

    NSSet *t =  [self.backgroundView allTargets];
    NSArray *touch = [self.backgroundView actionsForTarget:self.backgroundView forControlEvent:UIControlEventTouchUpInside];

But both structs get empty.

0

精彩评论

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