@@ -79,39 +79,6 @@ class CollaborativeSessions_ViewController: UIViewController, ARSCNViewDelegate,
7979 }
8080 }
8181
82- func session( _ session: ARSession , didAdd anchors: [ ARAnchor ] ) {
83- anchors. forEach { anchor in
84- if anchor. sessionIdentifier == self . sceneView. session. identifier {
85- //My own anchor was added
86- }
87- else {
88- //Another one's anchor was added
89- }
90- }
91- }
92-
93- func session( _ session: ARSession , didRemove anchors: [ ARAnchor ] ) {
94- anchors. forEach { anchor in
95- if anchor. sessionIdentifier == self . sceneView. session. identifier {
96- //My own anchor was removed
97- }
98- else {
99- //Another one's anchor was removed
100- }
101- }
102- }
103-
104- func session( _ session: ARSession , didUpdate anchors: [ ARAnchor ] ) {
105- anchors. forEach { anchor in
106- if anchor. sessionIdentifier == self . sceneView. session. identifier {
107- //My own anchor was updated
108- }
109- else {
110- //Another one's anchor was updated
111- }
112- }
113- }
114-
11582}
11683
11784// MARK: - MultipeerConnectivity
@@ -133,7 +100,7 @@ extension CollaborativeSessions_ViewController: MCSessionDelegate, MCNearbyServi
133100 do {
134101 try mpsession. send ( data, toPeers: mpsession. connectedPeers, with: . reliable)
135102 } catch {
136- print ( " ** error sending data to peers: \( error. localizedDescription) " )
103+ print ( " *** error sending data to peers: \( error. localizedDescription) " )
137104 }
138105 }
139106
@@ -148,12 +115,12 @@ extension CollaborativeSessions_ViewController: MCSessionDelegate, MCNearbyServi
148115 func session( _ session: MCSession , peer peerID: MCPeerID , didChange state: MCSessionState ) {
149116 switch state {
150117 case . notConnected:
151- print ( " state : \( state) " )
118+ print ( " *** estate : \( state) " )
152119 case . connected:
153- print ( " state : \( state) " )
120+ print ( " *** estate : \( state) " )
154121 self . participantID = peerID
155122 case . connecting:
156- print ( " state : \( state) " )
123+ print ( " *** estate : \( state) " )
157124 @unknown default :
158125 fatalError ( )
159126 }
0 commit comments