title: How to rearrange item of an array to new position in Swift?
body: <p>Consider the array <code>[1,2,3,4]</code>. How can I rearrange the array item to new position. </p>
  
  <p>For example: </p>
  
  <p><code>put 3 into position 4 [1,2,4,3]</code></p>
  
  <p><code>put 4 in to position 1 [4,1,2,3]</code></p>
  
  <p><code>put 2 into position 3 [1,3,2,4]</code>.</p>