iOS Firebase 框架是否在不同的队列上下载文件?

Does iOS Firebase framework downloads the file on different queue?

我有一个应用程序,我可以在其中向 Firebase 发送请求以从其数据库下载文件。

这是代码片段!

// Create a reference to the file you want to download
let islandRef = storageRef.child("images/island.jpg")
// Download in memory with a maximum allowed size of 1MB (1 * 1024 * 1024 bytes)
islandRef.dataWithMaxSize(1 * 1024 * 1024) { (data, error) -> Void in
  if (error != nil) {
    // Uh-oh, an error occurred!
  } else {
    // Data for "images/island.jpg" is returned
    // ... imageView.image = UIImage(data: data!)
  }
}

那么Firebase是否会在MAIN队列以外的其他队列中发送下载操作?我有疑问的原因是因为我想更新我的 imageView.image 以便它出现在屏幕上。我知道 iOS 框架需要主队列来更新 UI,所以我想确定是否需要在主队列上更新它!

Firebase 存储在单独的后台队列上进行下载,以免阻塞 UI,但会在主队列上显示回调,这样您就可以立即执行 UI 工作。

如果你想改变回调出现在哪个队列上,你可以使用FIRStorage.setCallbackQueue()方法(docs)。