Skip to content

Instantly share code, notes, and snippets.

@simform-solutions
Last active June 20, 2018 09:34
Show Gist options
  • Save simform-solutions/1ac394fd8f4b1511d39194ba76b21618 to your computer and use it in GitHub Desktop.
Save simform-solutions/1ac394fd8f4b1511d39194ba76b21618 to your computer and use it in GitHub Desktop.
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
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment