A description of the contact between two physics bodies.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 3.0+
SKPhysics object is created automatically by SpriteKit to describe a contact between two physical bodies in a physics world.To receive contact messages, read the
physics property of an
SKScene object you are interested in, and assign its
contact property to point to an object that implements the
SKPhysics protocol. Then, for each physics body in your scene, set the
contact properties to define which interactions should generate contact messages.