title: Copy object with value on swift
body: <p>I have a class Client which map on Core Data.</p>
  
  <pre><code>class Client: NSManagedObject {
      @NSManaged var firstName: String?
      @NSManaged var lastName: String?
      @NSManaged var age: Int?
  </code></pre>
  
  <p>I tried to implement NSCopy, I wrote this code</p>
  
  <pre><code>class Client: NSManagedObject, NSCopying {
      @NSManaged var firstName: String?
      @NSManaged var lastName: String?
      @NSManaged var age: Int?
  
      init(firstName: String, lastName: String, age: Int) {
          self.firstName = firstName?
          self.lastName = lastName?
          self.age = age?
      }
  
      func copy(with zone: NSZone? = nil) -&gt; Any {
          let copy = Person(firstName: firstName, lastName: lastName, age: age)
          return copy
      }
  }
  </code></pre>
  
  <p>But I get an error from xcode </p>
  
  <blockquote>
    <p>Type 'Client' does not conform to protocol 'NSCopying'</p>
  </blockquote>
  
  <p>Is there something missing or is there another solution beside structures to copy a client object with value?</p>