title: Overwrite on Core Data value
body: <p>hello I need to overwrite value on <code>CoreData</code> if already is. For example if already on <code>CoreData</code> I have Josh I need to delete this and next save new Josh </p>
  
  <pre><code>func save(value:String, forkey:String) {
      let context = getContext()
      let entity = NSEntityDescription.entity(forEntityName: "Lastname", in: context)
  
      let add = NSManagedObject(entity: entity!, insertInto: context)
      add.setValue(value, forKey: forkey)
  
      do {
          try context.save()
          print("save -&gt;  \(value)")
      } catch {
          print("err \(error)")
      }
  }
  </code></pre>