Skip to content

Instantly share code, notes, and snippets.

@bittz
Last active August 22, 2016 14:07
Show Gist options
  • Save bittz/43f00d81cde123036b6d to your computer and use it in GitHub Desktop.
Save bittz/43f00d81cde123036b6d to your computer and use it in GitHub Desktop.
Remove SKNode children whose names match the search parameter.
import SpriteKit
extension SKNode {
public func removeChildrenWithName(name: String) {
enumerateChildNodesWithName(name) { (node, stop) -> Void in
node.removeFromParent()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment