I want to add AR Quick Look to my app but placing the USDZ models into the app would take too much storage. That’s why I decided to store the models in Firebase Storage and download the model when needed. This is my code for quick looking a local USDZ model.
func numberOfPreviewItems(in controller: QLPreviewController) -> Int {
return 1
}
func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {
let url = Bundle.main.url(forResource: models[thumbnailIndex], withExtension: "usdz")!
return url as QLPreviewItem
}
func showModel() {
let previewController = QLPreviewController()
previewController.dataSource = self
previewController.delegate = self
present(previewController, animated: true)
}
How would I download the model from Firebase Storage and load it as such?