title: Implementing copy() in Swift
body: <p>I want to be able to copy a custom class in Swift. So far, so good. In Objective-C I just had to implement the <code>NSCopying</code> protocol, which means implementing <code>copyWithZone</code>.</p>
  
  <p>As an example, I have a basic class called <code>Value</code> which stores a <code>NSDecimalNumber</code>.</p>
  
  <pre><code>func copyWithZone(zone: NSZone) -&gt; AnyObject! {
      return Value(value: value.copy() as NSDecimalNumber)
  }
  </code></pre>
  
  <p>In Objective-C I, could easily just call <code>copy</code> to copy my object. In Swift, there seems to be no way to call <code>copy</code>. Do I really need to call <code>copyWithZone</code> even if no zone is needed? And which zone do I need to pass as a parameter?</p>