I have this code
SKPhysicsBody *firstBody, *secondBody;
if (contact.bodyA.categoryBitMask < contact.bodyB.categoryBitMask) {
firstBody = contact.bodyA;
secondBody = contact.bodyB;
} else {
firstBody = contact.bodyB;
secondBody = contact.bodyA;
}
I've captured this screenshot from my -(void)didBeginContact:(nonnull SKPhysicsContact *)contact method. I find it very confusing, because 2 & 3 == 2, but 4 & 3 == 0. As mentioned in docs,
If either comparison results in a nonzero value, an SKPhysicsContact object is created and passed to the physics world’s delegate.
I wonder how it is possible? Since second expression returns 0, why the delegate method is called?
