Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 处理应用程序中的用户交互_Swift_Swift3_User Interaction - Fatal编程技术网

Swift 处理应用程序中的用户交互

Swift 处理应用程序中的用户交互,swift,swift3,user-interaction,Swift,Swift3,User Interaction,在我的应用程序中,当我想禁用用户交互时,我会使用此选项: UIApplication.shared.beginIgnoringInteractionEvents() 但上述行与以下行有何不同: self.view.isUserInteractionEnabled = false 何时使用上面的某些行有什么规则吗?self.view.isUserInteractionEnabled=false在单个UIView上工作,其中作为UIApplication.shared.beginIgnoring

在我的应用程序中,当我想禁用用户交互时,我会使用此选项:

UIApplication.shared.beginIgnoringInteractionEvents()
但上述行与以下行有何不同:

self.view.isUserInteractionEnabled = false

何时使用上面的某些行有什么规则吗?

self.view.isUserInteractionEnabled=false
在单个
UIView
上工作,其中作为
UIApplication.shared.beginIgnoringInteractionEvents()
包括整个
ui窗口
意味着
UINavigationBar
上的迭代不包括在
self.view.isUserInteractionEnabled

如果您试图在执行某些UI操作(如绘图或动画)时暂停用户交互,并且不希望用户中断此过程,则应使用
UIApplication.shared.beginIgnoringInteractionEvents()

如果您试图限制单个
UIView
上的交互,比如说
UILabel``或
UIImage```那么您应该选择
self.view.isUserInteractionEnabled=false


希望有帮助。快乐编码:)

self.view.isUserInteractionEnabled=false
在个人
UIView
上工作,其中作为
UIApplication.shared.beginIgnoringInteractionEvents()
包括整个
ui窗口
意味着
UINavigationBar
上的迭代不包括在
self.view.isUserInteractionEnabled

如果您试图在执行某些UI操作(如绘图或动画)时暂停用户交互,并且不希望用户中断此过程,则应使用
UIApplication.shared.beginIgnoringInteractionEvents()

如果您试图限制单个
UIView
上的交互,比如说
UILabel``或
UIImage```那么您应该选择
self.view.isUserInteractionEnabled=false


希望有帮助。快乐编码:)

谢谢你的回答。很高兴它有帮助。谢谢你的回答。很高兴它有帮助。