title: Swift create new arrays based on a single array from a property
body: <p>I'm rater new to Swift and I'm stuck in a piece of code where I have to convert a single dimensional array of items,
  to a new multidimensional array but grouping the items checking for a similarity of a variable.</p>
  
  <p>Like this:</p>
  
  <pre><code>var arr1 = [("polly", 23, uk), ("polly", 19, canada), ("polly", 29, us), ("jenny", 78, ireland), ("jenny", 78, ireland)....]
  </code></pre>
  
  <p>then, grouping all the items by the same name, I wish to have this:</p>
  
  <pre><code>arrA = (do some code and return this) [("polly", 23, uk), ("polly", 19, canada), ("polly", 29, us)]
  arrB = (do some code and return this) [("jenny", 78, ireland), ("jenny", 78, ireland)]
  
  arrFinal = [arrA, arrB]
  </code></pre>
  
  <p>Basically, I have a list of items to split in each group in a tableview,
  each section need to show the items that have the same property, and the user
  choose from a menu, which property use (name, age or enumerator) to group
  all the items per each section.</p>
  
  <p>Thanks!</p>