简体   繁体   English

独特的UIControl

[英]Exclusive touch on UIControl

I have an UIButton and UISwitch . 我有一个UIButtonUISwitch A user could touch both with one finger each at the same time and release - triggering 2 separate TouchUpInside @IBAction s. 用户可以同时用一根手指触摸两个手指并释放-触发2个单独的TouchUpInside @IBAction

How can I tell a control that it's touches must be exclusive, without creating a subclass? 如何在不创建子类的情况下告诉控件它的触摸必须是独占的?

UIControl是UIView的子类,因此您可以在任何UI控件上直接设置ExclusiveTouch = true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM