How to block UI in IPhone

删除回忆录丶 提交于 2019-12-11 16:35:59

问题


How can I block UI thread without using sleep?

Just to be clear: I understand that UI will freeze for user, but that is the idea.

Can I run empty RunLoops? Any other ways.


回答1:


If you just want to block all interaction with your UI, call the UIApplication method -beginIgnoringInteractionEvents. If you're actually trying to prevent the entire UI from doing anything (which is not a good idea—your application might block the appearance of a system notification, for instance), then yes, an NSRunLoop would probably be the right approach.



来源:https://stackoverflow.com/questions/3113680/how-to-block-ui-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!