title: Beginner Swift 3: How to find pairs in array that add up to given number
body: <p>Need to loop through an array and say whether there are any pairs of numbers that sum to 8</p>
  
  <p>e.g. [1,2,4,4] = yes</p>
  
  <p>Can get it working with lots of nested if statements but this will be impractical if the array changes. </p>
  
  <p>What I'd ideally like to do is say for i if i + (i.indexPosition +1 {Number next to i})) == 8 then print true, if not false, then move onto the next iteration of numbersSet</p>
  
  <p>Wondering if someone knew some better logic that could be used here? Many thanks!!</p>
  
  <p>E.g.</p>
  
  <pre><code>var numbersSet = [1, 2, 4, 4]
  
  for i in numbersSet2 {
  
      var targetSum = 8
  
      if i + numbersSet2[1] == targetSum {
  
          print("True")
      } else { // Nested if statements here
  
          print("False")
      }
  }
  </code></pre>