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) Object – bit masks!
ball.physicsBody?.categoryBitMask = PhysicsCategory.Ball
ball.physicsBody?.collisionBitMask = PhysicsCategory.Border | PhysicsCategory.Ball
ball.physicsBody?.contactTestBitMask = PhysicsCategory.Squared