title: In Swift, can I write a generic function to resize an array?
body: <p>I have this function:</p>
  
  <pre><code>func sizeArray(inout array:Array&lt;String&gt;, size:Int) {
  
      while (array.count &lt; size) {
          array.append("")
      }
  
      while (array.count &gt; size) {
          array.removeLast()
      }
  }
  </code></pre>
  
  <p>It works, but only with Array of String, can I make it generic to work with any type?</p>