title: How to switch object load in Swift Scenekit?
body: <p>I want to load objects using iOS SceneKit.</p>
  
  <p>And how do I unload a loaded object and reload another object?</p>
  
  <p>I succeeded in loading the object by referring to the code <a href="https://github.com/pjardin/Blender-Motion-Capture/blob/master/Blender%20Motion%20Capture/Blender%20Motion%20Capture/FacialCaptureView.swift" rel="nofollow noreferrer">below</a>.</p>
  
  <pre><code>func sceneSetup() {
  
      if let filePath = Bundle.main.path(forResource: "Smiley", ofType: "scn") {
          let referenceURL = URL(fileURLWithPath: filePath)
  
          self.contentNode = SCNReferenceNode(url: referenceURL)
          self.contentNode?.load()
          self.head.morpher?.unifiesNormals = true // ensures the normals are not morphed but are recomputed after morphing the vertex instead. Otherwise the node has a low poly look.
          self.scene.rootNode.addChildNode(self.contentNode!)
      }
      self.faceView.autoenablesDefaultLighting = true
  
      // set the scene to the view
      self.faceView.scene = self.scene
  
      // allows the user to manipulate the camera
      self.faceView.allowsCameraControl = false
  
      // configure the view
      self.faceView.backgroundColor = .clear
  }
  </code></pre>
  
  <p>But I don't know how to load and switch multiple objects.</p>
  
  <p>I added testScene.scn to the project and added the code as below, but only the first specified object was loaded.</p>
  
  <pre><code>var charaSelect = "Smiley"
  
  //tapEvent(ViewDidLoad)
      let tapGesture = UITapGestureRecognizer(target: self, action: #selector(FaceGeoViewController.tapped(_:)))
      tapGesture.delegate = self
      self.view.addGestureRecognizer(tapGesture)
  
  //tap
   @objc func tapped(_ sender: UITapGestureRecognizer)
   {
      self.charaSelect = "testScene"
   }
  
  func sceneSetup() {
  
      if let filePath = Bundle.main.path(forResource: self.charaSelect, ofType: "scn") {
          let referenceURL = URL(fileURLWithPath: filePath)
  
          self.contentNode = SCNReferenceNode(url: referenceURL)
          self.contentNode?.load()
          self.head.morpher?.unifiesNormals = true // ensures the normals are not morphed but are recomputed after morphing the vertex instead. Otherwise the node has a low poly look.
          self.scene.rootNode.addChildNode(self.contentNode!)
      }
      self.faceView.autoenablesDefaultLighting = true
  
      // set the scene to the view
      self.faceView.scene = self.scene
  
      // allows the user to manipulate the camera
      self.faceView.allowsCameraControl = false
  
      // configure the view
      self.faceView.backgroundColor = .clear
  }
  </code></pre>
  
  <p>What should I do?</p>