Advertisement
Cabaca

Untitled

Aug 1st, 2024
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.39 KB | None | 0 0
  1.  var worldAnchors: [UUID: String] = [:]
  2.  
  3.     func saveWorldAnchors() {
  4.         let encoder = JSONEncoder()
  5.         do {
  6.             let jsonString = try encoder.encode(worldAnchors)
  7.             let filePath = // define your filepath here
  8.  
  9.             do {
  10.                 try jsonString.write(to: filePath)
  11.             } catch {
  12.                 print(error)
  13.             }
  14.         } catch {
  15.             print(error)
  16.         }
  17.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement