Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func receivedData(_ data: Data, from peer: MCPeerID) {
- if let unarchived = try? NSKeyedUnarchiver.unarchivedObject(of: ARWorldMap.classForKeyedArchiver()!, from: data), let worldMap = unarchived as? ARWorldMap {
- // Run the session with the received world map.
- let configuration = ARWorldTrackingConfiguration()
- configuration.planeDetection = .horizontal
- configuration.initialWorldMap = worldMap
- sceneView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
- mapProvider = peer
- }
- }
Add Comment
Please, Sign In to add comment