title: Cloning a UIImageView
body: <p>I have an UIImageView:</p>
  
  <pre><code>let imageView = UIImageView()
  imageView.image = UIImage(named: "name")
  imageView.layer.cornerRadius = 30
  imageView.layer.masksToBounds = true
  
  // .. constraints to imageView
  
  view.addSubview(imageView)
  </code></pre>
  
  <p>I am trying to create a duplicate copy of that same <code>imageView</code> and store it in another variable. I tried to use <code>NSKeyedArchiver</code> but it did not work, here is what I have: </p>
  
  <pre><code>extension UIView {
     func copyView&lt;T: UIView&gt;() -&gt; T {
          return NSKeyedUnarchiver.unarchiveObject(with: NSKeyedArchiver.archivedData(withRootObject: self)) as! T
      }
  }
  </code></pre>
  
  <p>My goal is to have an imageView, <code>cloneImageView</code>, to be an exact duplicate of <code>imageView</code></p>
  
  <pre><code>var cloneImageView = imageView.copyView() 
  </code></pre>