Check out example codes for "remove child from scene swift". It will help you in understanding the concepts better.

Code Example 1

if let child = self.childNode(withName: "object") as? SKSpriteNode {
    child.removeFromParent()
}

Learn ReactJs, React Native from akashmittal.com