In my case i just wanted to create an object and not persist it. so segiddins
's solution didn't work for me.
Swift 3
To create a clone of user object in swift
just use
let newUser = User(value: oldUser)
;
The new user object is not persisted.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…