I have this spaceshooter game where it spawns enemy ships randomly. once the player reaches 30, it would spawn a "Boss" Sprite. In the original App, I have it set up to where the boss would appear and only move left and right because I ran into an issue with the sprite disappearing once it collided with the bullet.
I do not have it set up to where if both contacts were made, it would remove the Boss from parent.
I tried to close in on the problem by copying the app and deleting everything besides the player and the boss sprite.
The sprite disappears when physicsWorld.contactDelegate = self is set so it is a collision issue.
Could this be a bug with the xcode?
It is not the image itself because i took out the images and i am using just the placeholder image (big red X) saying that no image of that name was found.
Here is a gif of what it looks like
http://g.recordit.co/8ucvkrwR4Z.gif
the left side of the screen shows the bullets being shot from bottom to top the image coming from right to left is the boss sprite
Here is my gamescene.swift
import SpriteKit
import UIKit
struct PhysicsCatagory {
    static let Enemy : UInt32 = 1 /
    static let Bullet : UInt32 = 0b1 /
    static let Player : UInt32 = 4 /
    static let tj: UInt32  = 0b10
   
}
class GameScene: SKScene, SKPhysicsContactDelegate {
   
    var Highscore = Int()
    var Score = Int()
    var BossCounter = Int()
    var TJBossHIT = Int()
   
    var Player = SKSpriteNode(imageNamed: "player")
    var Enemy = SKSpriteNode(imageNamed: "Enemy.png")
    var TJ = SKSpriteNode(imageNamed: "tjBoss9.png")
    var Fake = SKSpriteNode(imageNamed: "tjBoss.png")
    var ScoreLbl = UILabel()
   
    let HealthBarWidth: CGFloat = 100
    let HealthBarHeight: CGFloat = 40
    var TJHealth = 20
   
    override func didMoveToView(view: SKView) {
       
       
        Score = 0
       
        physicsWorld.contactDelegate = self
         /
         self.scene?.size = CGSize(width: 640, height: 1136)
        self.scene?.zPosition = 0
        Player.position = CGPointMake(self.size.width / 2, self.size.height / 5)
        Player.physicsBody = SKPhysicsBody(rectangleOfSize: Player.size)
        Player.physicsBody?.affectedByGravity = false
        Player.physicsBody?.categoryBitMask = PhysicsCatagory.Player
        Player.physicsBody?.contactTestBitMask = PhysicsCatagory.Enemy
        Player.physicsBody?.dynamic = false
          var Timer = NSTimer.scheduledTimerWithTimeInterval(0.3, target: self, selector: Selector("SpawnBullets"), userInfo: nil, repeats: true)
       
       
  
       
   
          let enemy1SpawnDelay = SKAction.waitForDuration(0.5)
       
  
       
        runAction(
            SKAction.sequence([
                enemy1SpawnDelay,
                SKAction.runBlock({self.SpawnTJ()}),
                SKAction.waitForDuration(0.4)]) , withKey: "SpawnStop")
   
       
    }
   
   
   
    func didBeginContact(contact: SKPhysicsContact) {
       
  
            var firstBody : SKPhysicsBody = contact.bodyA
            var secondBody : SKPhysicsBody = contact.bodyB
            /
            if (((firstBody.categoryBitMask == PhysicsCatagory.tj) && (secondBody.categoryBitMask == PhysicsCatagory.Bullet)) ||
                ((firstBody.categoryBitMask == PhysicsCatagory.Bullet) && (secondBody.categoryBitMask == PhysicsCatagory.tj))){
                   
                    /
                    CollisionWithTJBoss(firstBody.node as! SKSpriteNode, TJ: secondBody.node as! SKSpriteNode)
                   
        }
    }
   
    func CollisionWithBullet(Enemy: SKSpriteNode, Bullet:SKSpriteNode){
        Enemy.removeFromParent()
        Bullet.removeFromParent()
        Score++
       
       
        ScoreLbl.text = "\(Score)"
        print(Score)
    }
    func SpawnTJ() {
       
        TJ.physicsBody = SKPhysicsBody(rectangleOfSize: TJ.size)
        TJ.physicsBody?.categoryBitMask = PhysicsCatagory.tj
        TJ.physicsBody?.contactTestBitMask = PhysicsCatagory.Bullet
       
       
        TJ.physicsBody?.affectedByGravity = false
        TJ.physicsBody?.dynamic = true
        TJ.physicsBody?.allowsRotation = false
       
       
        TJ.position = CGPoint(x: self.size.width / 2, y: self.size.height + 30)
        TJ.zPosition = 0.1
       
        /
        let moveDown = SKAction.moveToY(self.size.height / 2, duration: 5.0)
       
        let moveRight = SKAction.moveByX(200, y: 0, duration: 2.0)
        let moveLeft = SKAction.moveByX(-200, y: 0, duration: 3.0)
       
        let reverseMoveRight = moveRight.reversedAction()
        let reverseMoveLeft = moveLeft.reversedAction()
       
        let sequence1 = SKAction.sequence([moveRight, reverseMoveRight, moveLeft, reverseMoveLeft])
        /
        /
       
       
       
        TJ.runAction(SKAction.sequence([moveDown]))
        TJ.runAction(SKAction.repeatActionForever(sequence1), withKey: "TJBossEnd")
       
        self.addChild(TJ)
       
    }
   
        func CollisionWithTJBoss (Bullet: SKSpriteNode, TJ:SKSpriteNode)
    {
        Bullet.removeFromParent()
        TJBossHIT++
        NSLog("Hit")
        print(TJBossHIT)
       
       
    }
   
    func SpawnBullets(){
       
        let Bullet = SKSpriteNode(imageNamed: "Bullets")
        Bullet.zPosition = -2
        Bullet.position = CGPointMake(Player.position.x, Player.position.y)
       
        let action = SKAction.moveToY(self.size.height + 15, duration: 0.8)
        let actionDone = SKAction.removeFromParent()
        Bullet.runAction(SKAction.sequence([action, actionDone]))
       
        Bullet.physicsBody = SKPhysicsBody(rectangleOfSize: Bullet.size)
        Bullet.physicsBody?.categoryBitMask = PhysicsCatagory.Bullet
        Bullet.physicsBody?.contactTestBitMask = PhysicsCatagory.Enemy
       /
        Bullet.physicsBody?.contactTestBitMask = PhysicsCatagory.tj
       
        Bullet.physicsBody?.affectedByGravity = false
        Bullet.physicsBody?.dynamic = false
        self.addChild(Bullet)
    }
    override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
       
        for touch: AnyObject in touches {
            let location = touch.locationInNode(self)
           
            Player.position.x = location.x
       
        }
       
        }
        override func touchesMoved(touches: Set<UITouch>, withEvent event: UIEvent?) {
           
            for touch: AnyObject in touches {
                let location = touch.locationInNode(self)
               
                Player.position.x = location.x
               
            }
           
        }
  
    override func update(currentTime: CFTimeInterval) {
        / Called before each frame is rendered */
    }
}