Preventing multiple buttons from being touched at the same time

前端 未结 6 1495
猫巷女王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:58

    You can also use below method. If you have two buttons or more, to prevent multiple push at a time.

    for e.g,

    [Button1 setExclusiveTouch:YES];
    
    [Button2 setExclusiveTouch:YES];
    

    Set this method in your viewDidLoad or viewWillAppear

提交回复
热议问题