yes, im load worldMap form appdata,
do {
let data = try Data(contentsOf: fileURL)
if let worldMap = try NSKeyedUnarchiver.unarchivedObject(ofClass: ARWorldMap.self, from: data) {
arWorldTrackingConfig.initialWorldMap = worldMap
arSession.run(arWorldTrackingConfig)
if #available(iOS 17.0, *) {
roomCaptureView = RoomCaptureView(frame: view.bounds, arSession: arSession)
}
else{
roomCaptureView = RoomCaptureView(frame: view.bounds)
}
and use roomCaptureView?.captureSession.arSession.getCurrentWorldMap to save wordMap with let data = try NSKeyedArchiver.archivedData(withRootObject: worldMap, requiringSecureCoding: true) try data.write(to: fileURL)
but it's not working very well, sometimes I can't scan(black screen), and I can't merge data with previous room
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: