简体   繁体   English

将哪个GCD队列放入Firebase操作? 迅捷4

[英]which GCD queue to put firebase operations in? swift 4

Which queue is the best to place firebase operations? 哪个队列最适合放置Firebase操作? Is it the background queue, the main queue, or does it depend on how heavy the operation is? 是后台队列,主队列,还是取决于操作的繁重程度?

It sort of depends on how much work you're doing in Firebase. 取决于您在Firebase中进行的工作量。

You can start out doing everything on the main thread. 您可以开始在主线程上做所有事情。 If you notice your UI lagging, switch to a background queue, and wrap all of your UI calls in a Dispatch.async call to the main thread. 如果您发现UI滞后,请切换到后台队列,然后将所有UI调用包装在对主线程的Dispatch.async调用中。

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

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