Copy and paste the coredata object in my project iOS swift
Problem: I want to copy my coredata object into cache and paste it somewhere in my project.How can i achieve that? Solution: You have to achieve that by using userdefaults in your project.But you cannot save the entire object in the defaults.So you have to store the coredata object ID in the defaults. While paste fetch the object based on coredata id and then paste it somewhere. // MARK: - copy and paste the object func setCopyMyObj ( value : myObject ) { self . userDefaults . set (value. ob jectID . uriRepresentation (). abs oluteString , forKey : " myobj " ) self . saveValue () } func removeCopyObj () { self . userDefaults . removeObject ( forKey : " myobj " ) self . saveValue () ...