title: Swift detect touch in both left and right side of screen simultaneously
body: <p>I've been able to detect if the user is touching the left or right side of the screen and then perform a function. I'm trying to detect if both sides of the screen are being touched simultaneously and if so perform another function. </p>
  
  <p>This is what I have which isn't working for when both sides of the screen are being touched at the same time. </p>
  
  <p>This is in the update function.</p>
  
  <pre><code>if (touched) {
          var isRight : Bool = false
          var isLeft : Bool = false
  
          if(location.x &lt; 0){
          isLeft = true
          moveLeft()
          }
          else if(location.x &gt; 0){
          isRight = true
          moveRight()
  
  
              }
          else if (isRight &amp;&amp; isLeft){
              moveUp()
  
  
          }
  
      }
  </code></pre>