@brandonK212 Thanks for the answer! Two more questions: How to make sure that the file is loaded not when you open the application, but after clicking the button. So that when you click on a button, it loads and opens in turn?
How to make sure that after closing AR Quick Look these files are deleted from memory? I found the code but it doesn't seem to delete files!
@IBAction func removeAllFiles(){
let documentsUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
do {
let fileURLs = try FileManager.default.contentsOfDirectory(at: documentsUrl,
includingPropertiesForKeys: nil,
options: .skipsHiddenFiles)
for fileURL in fileURLs {
if fileURL.pathExtension == "usdz" {
try FileManager.default.removeItem(at: fileURL)
}
}
} catch { print(error) }
}
Topic:
Programming Languages
SubTopic:
Swift
Tags: