How can I easily duplicate/copy an existing realm object

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.

Leave a Comment