Preventing multiple buttons from being touched at the same time

前端 未结 6 1502
猫巷女王i
猫巷女王i 2021-02-01 02:24

In iOS is there anyway to prevent a UIView containing multiple buttons (siblings) from being simultaneously from being touched? For instance, two non-overlapping buttons that ar

6条回答
  •  梦谈多话
    2021-02-01 02:47

    for(UIView* v in self.view.subviews)
        {
        if([v isKindOfClass:[UIButton class]])
        {
            UIButton* btn = (UIButton*)v;
            [yourButton setExclusiveTouch:YES];
        }
    }
    

提交回复
热议问题