#Swift Sprite Kit# ## Remove Node, if Node leave View## set ``` var newSprit = SKSpriteNode() ``` create function for Node create ``` func createNewSprite(point : CGPoint) { newSprit = SKSpriteNode(color: UIColor.orange, size: CGSize(width: 50, height: 50)) newSprit.physicsBody = SKPhysicsBody(rectangleOf: CGSize(width: 50, height: 50)) newSprit.position = point self.addChild(newSprit) } ``` on ```override func update(_ currentTime: TimeInterval)``` add new code ``` self.enumerateChildNodes(withName: String, using: (SKNode, UnsafeMutablePointer) -> Void) ``` check your View first, if your View setup by Portrait, you may check your node leave view by point X if your View setup by Landscape, you may check your node leave view by point y Code: ``` self.enumerateChildNodes(withName: "TEST") { (node : SKNode, nil) in if node.position.x 320 { print("remove node") node.removeFromParen...