Guest User

Untitled

a guest
Jun 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. func receivedData(_ data: Data, from peer: MCPeerID) {
  2. if let unarchived = try? NSKeyedUnarchiver.unarchivedObject(of: ARWorldMap.classForKeyedArchiver()!, from: data), let worldMap = unarchived as? ARWorldMap {
  3. // Run the session with the received world map.
  4. let configuration = ARWorldTrackingConfiguration()
  5. configuration.planeDetection = .horizontal
  6. configuration.initialWorldMap = worldMap
  7. sceneView.session.run(configuration, options: [.resetTracking, .removeExistingAnchors])
  8. mapProvider = peer
  9. }
  10. }
Add Comment
Please, Sign In to add comment