title: iOS Swift didBeginContact not being called
body: <p>I have been struggling for the past two days to get two SKSpriteNodes to register a collision and evoke <code>didBegin#contact</code>.</p>
  
  <p>I've set their bit masks '<code>categoryBitMask</code>', '<code>contactTestBitMask</code>' and '<code>collisionTestBitMask</code>' for both objects.</p>
  
  <p>I've also set the '<code>dynamic</code>' property for both to '<code>true</code>'</p>
  
  <p><code>initPhysics()</code> seems to set up the physicsWorld okay.</p>
  
  <p>All I'm expecting is that <code>didBegin#Contact</code> is called, but it is not</p>
  
  <pre><code>//Set up Physicsbody bit masks
  let playerCarBitMask: UInt32 = 0x1 &lt;&lt; 1
  let slowCarBitMask: UInt32 = 0x1 &lt;&lt; 2
  
  
  
  //initPhysics
  func initPhysics() {
      println("(((((((((((((( Initiating Physicsbody ))))))))))))))")
      self.physicsWorld.contactDelegate = self
      self.physicsWorld.gravity = CGVector.zeroVector
  
      println("self.physicsWorld.contactDelegate = \(self.physicsWorld.contactDelegate)")
  
  }
  
  //setupPlayer
  func setupPlayer() {
  
      car = SKSpriteNode(imageNamed: "redCarUp")
      car.setScale(2.0)
      car.position = CGPoint(x: 800, y: 400)
      car.zPosition = 100
      car.name = "car"
  
      gameNode.addChild(car)
  
      let carBody = SKPhysicsBody(
          rectangleOfSize: car.frame.size, center: car.position)
  
      carBody.dynamic = true
      carBody.categoryBitMask = playerCarBitMask
      carBody.contactTestBitMask = slowCarBitMask
      carBody.mass = 5
      carBody.collisionBitMask = slowCarBitMask
      car.physicsBody = carBody
  
      println("carBody = \(carBody)")
      println("carBody.dynamic = \(carBody.dynamic)")
      println("carBody.mass = \(carBody.mass)")
      println("carBody.categoryBitMask = \(carBody.categoryBitMask)")
      println("carBody.contactTestBitMask = \(carBody.contactTestBitMask)")
      println("carBody.collisionBitMask = \(carBody.contactTestBitMask)")
  
  
  
      slowCar = SKSpriteNode(imageNamed: "blueCarUp")
      slowCar.setScale(2.0)
      let slowCarScenePos = CGPoint(
          x: 680,
          y: 2048)
  
  
      slowCar.position = gameNode.convertPoint(slowCarScenePos, fromNode: self)
      println("slowCar.position = \(slowCar.position) ****")
      slowCar.zPosition = 80
      slowCar.name = "slowCar"
  
  
  
      let slowCarBody = SKPhysicsBody(
          rectangleOfSize: slowCar.frame.size, center: slowCar.position)
  
  
      println("slowCar = \(slowCar) ****")
  
      slowCarBody.dynamic = true
      slowCarBody.categoryBitMask = slowCarBitMask
      slowCarBody.contactTestBitMask = playerCarBitMask
      slowCarBody.mass = 5
      slowCarBody.collisionBitMask = playerCarBitMask
      slowCar.physicsBody = slowCarBody
      gameNode.addChild(slowCar)
  
  
  
  }
  
  func didBeginContact(contact: SKPhysicsContact!) {
      println("*******************PhysicsContact********************")
  }
  </code></pre>