Class SKPhysicsContactDelegate implementing physics objects interactions.
An object that implements the SKPhysicsContactDelegate protocol can respond when two physics bodies with overlapping contactTestBitMask values are in contact with each other in a physics world. To receive contact messages, you set the contactDelegate property of a SKPhysicsWorld object. The delegate is called when a contact starts or ends.
Important
The physics contact delegate methods are called during the physics simulation step. During that time, the physics world can not be modified and the behavior of any changes to the physics bodies in the simulation is undefined. If you need to make such changes, set a flag inside didBegin (_ 🙂 or didEnd (_ 🙂 and make changes in response to that flag in the update (_: for 🙂 method in a SKSceneDelegate.

Tutorial Xcode swift

Language programming swift