Advertisement
Cabaca

Untitled

Aug 1st, 2024
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.47 KB | None | 0 0
  1. func loadWorldAnchors() {
  2.         let filePath = // use the same file path
  3.        
  4.         guard let filePath, FileManager.default.fileExists(atPath: filePath.path(percentEncoded: true)) else {
  5.             return
  6.         }
  7.  
  8.         do {
  9.             let data = try Data(contentsOf: filePath)
  10.             worldAnchors = try JSONDecoder().decode([UUID: String].self, from: data)
  11.         } catch {
  12.             print("Failed to restore the mapping from world anchors to persisted objects.")
  13.         }
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement