The getData
call for RTDB completion handler is not called on the main thread
#8245
Labels
Milestone
getData
call for RTDB completion handler is not called on the main thread
#8245
[REQUIRED] Step 1: Describe your environment
CocoaPods | Carthage | Zip file | Swift Package Manager
(select one)[REQUIRED] Step 2: Describe the problem
See https://stackoverflow.com/q/67941742 for the original report.
Steps to reproduce:
While the Firebase SDK performs its network and other I/O on a background thread, it actually calls your callback on the main thread.
But it seems that
getData
does not do that here. See below for relevant code. 👇Relevant Code:
This works
This throws an error
UICollectionView.reloadData() must used from main thread only
:databaseReference.getData { [weak self] error, snapshot in
guard let self = self else { return }
self.tableView.reloadData()
}
The text was updated successfully, but these errors were encountered: