title: Swift: How to assign a variable by reference, not by value?
body: <p>I'm trying to get a reference to an <code>Array</code> and make modifications to it.  Because <code>Array</code>s in Swift are value types, instead of reference types, if I assign my array to a variable first, I am getting a copy of the array instead of the actual array:</p>
  
  <pre><code>var odds = ["1", "3", "5"]
  var evens = ["2", "4", "6"]
  
  var source = odds
  var destination = evens
  
  var one = odds.first!
  
  source.removeFirst() // only removes the first element of the `source` array, not the `odds` array
  
  destination.append(one)
  </code></pre>
  
  <p>When we look at the <code>odds</code> and <code>evens</code> arrays, they are unaltered because we changed the <code>source</code> and <code>destination</code> arrays.</p>
  
  <p>I know that I can use the <code>inout</code> parameter attribute on a function to pass them by reference, instead of by value:</p>
  
  <pre><code>func move(inout source: [String], inout destination: [String], value:String) {
      source.removeAtIndex(source.indexOf(value)!)
      destination.append(value)
  }
  
  move(&amp;odds, destination: &amp;evens, value:one)
  </code></pre>
  
  <p><strong>Is there a way to assign these arrays to a variable by reference, instead of by value?</strong></p>