Last active
August 22, 2016 14:07
-
-
Save bittz/43f00d81cde123036b6d to your computer and use it in GitHub Desktop.
Remove SKNode children whose names match the search parameter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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