For the object, you can assign bit masks: categoryBitMask, collisionBitMask, and contactTestBitMask.
CategoryBitMask – a mask that determines which categories this physics body belongs to.
CollisionBitMask – a mask that determines which categories of physics bodies can collide with this physics body.
ContactTestBitMask – a mask that determines which categories.

Swift programming
Help tutorial swift