title: Rotating SceneKit Cylinder Around A Single Axis
body: <p>I have the following code to enable the display of a 3D cylinder within a view.  When viewing it on the device, gestures rotate the cylinder on both the x-axis (swipe up and down gesture) and y axis (swipe left and right), but the z axis is locked.  This, I believe is the default for allowsCameraControl.</p>
  
  <p>What I would like to do is lock the x-axis (I think) so that only left and right swipe gestures work.  I shouldn't be able to see the top or the bottom of the cylinder. I would like to keep the default rotation whilst swiping left and right (i.e. it naturally slows down after swipe). </p>
  
  <p>Any help gratefully received!</p>
  
  <pre><code>class MyCollectionViewController: UIViewController {
  
  @IBOutlet weak var scnView: SCNView!
  
  var scnScene: SCNScene!
  
  
  override func viewDidLoad() {
      super.viewDidLoad()
      sceneSetup()
  }
  
  
  // MARK: Scene
  func sceneSetup() {
  
      scnScene = SCNScene()
  
      let cylinder = SCNNode(geometry: SCNCylinder(radius: 5.0, height: 20))
      cylinder.geometry?.firstMaterial?.diffuse.contents = UIImage(named: "image1")
      cylinder.geometry?.firstMaterial?.specular.contents = UIColor.white
  
      scnView.allowsCameraControl = true
  
      scnScene.rootNode.addChildNode(cylinder)
  
      scnView.autoenablesDefaultLighting = true
  
      scnView.scene = scnScene
  }
  </code></pre>
  
  <p>}</p>