SKPhysicsContactDelegate Protocol Reference

Conforms to
Framework
/System/Library/Frameworks/SpriteKit.framework
Availability
Available in iOS 7.0 and later.
Companion guide
Declared in
SKPhysicsWorld.h

Overview

An object that implements the SKPhysicsContactDelegate protocol can respond when two physics bodies 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.

Tasks

Responding to Contact Events

Instance Methods

didBeginContact:

Called when two bodies first contact each other.

- (void)didBeginContact:(SKPhysicsContact *)contact
Parameters
contact

An object that describes the contact.

Availability
  • Available in iOS 7.0 and later.
Declared In
SKPhysicsWorld.h

didEndContact:

Called when the contact ends between two physics bodies.

- (void)didEndContact:(SKPhysicsContact *)contact
Parameters
contact

An object that describes the contact.

Availability
  • Available in iOS 7.0 and later.
Declared In
SKPhysicsWorld.h