title: Delete all occurrences of value in Swift Array
body: <p>So I have an array of Int's and I am trying to create a function to delete a certain value from the array. However, the removeAtIndex() function only deletes the first occurrence and the removeLast() only removes the last. I tried enumerating through the array but I end up with an Array index out of range error, possible due to the reshifting that occurs when deleting an item from the array.</p>
  
  <pre><code>  for (index, value) in connectionTypeIDs.enumerate() {
              if (value == connectionTypeToDelete){
                  connectionTypeIDs.removeAtIndex(index)
              }
          }
  </code></pre>
  
  <p>Any ideas on how to accomplish this?</p>