Swift Playgrounds

Hi everyone At the moment I try to use augmented reality QuickLook in Swift playgrounds When I try to open the reality file from the resource folder, this error shows up. Have someone an idea to fix that problem? Thanks in advance


import QuickLook

import RealityKit

import ARKit



struct ARQLViewController: UIViewControllerRepresentable {

    func makeUIViewController(context: Context) -> some UIViewController {

        return UINavigationController.init(rootViewController: ViewController())

    }

    func updateUIViewController(_ uiViewController: UIViewControllerType, context: Context) {}

}



class ViewController: UIViewController, QLPreviewControllerDataSource {

    var isAppeard: Bool = false

    override func viewDidLoad() {

        super.viewDidLoad()

        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {

            let previewController = QLPreviewController()

            previewController.dataSource = self

            self.present(previewController, animated: true, completion: nil)

        }

    }

   override func viewDidAppear(_ animated: Bool) {

        guard !isAppeard else { return }

        isAppeard = true

   

    }

    func numberOfPreviewItems(in controller: QLPreviewController) -> Int { return 1 }

    func previewController(_ controller: QLPreviewController, previewItemAt index: Int) -> QLPreviewItem {

        guard let path = Bundle.main.path(forResource: "SipARAnimation", ofType: "reality") else { fatalError("Couldn't find the supported input file.") }

        let url = URL(fileURLWithPath: path)

        return url as QLPreviewItem

    }

}


Swift Playgrounds
 
 
Q