Reputation: 139
Firebase's callback functions are executed in the main thread. How do I schedule work to perform on the background thread with Swift?
Upvotes: 1
Views: 905
Reputation: 600126
Firebase already performs all its network and disk I/O off the main thread, and only then calls your code on the main thread so that you can update the UI.
If you want to then schedule your code to run on another thread, that has nothing to do with Firebase anymore. I recommend looking at some of these search results, like this one on dispatch queues: How to use background thread in swift?
Upvotes: 2