title: Create a copy of a UIView in Swift
body: <p>Because objects are reference types, not value types, if you set a <code>UIView</code> equal to another <code>UIView</code>, the views are the same object. If you modify one you'll modifying the other as well.</p>
  
  <p>I have an interesting situation where I would like to add a <code>UIView</code> as a subview in another view, then I make some modifications, and those modifications should not affect the original <code>UIView</code>. How can I make a copy of the <code>UIView</code> so I can ensure I add that copy as a subview instead of a reference to the original <code>UIView</code>? </p>
  
  <p>Note that I can't recreate the view in the same way the original was created, I need some way to create a copy given any <code>UIView</code> object.</p>