I know that I can get a list of class properties with Mirror(reflecting:), but I can print them. But what if I want to set properties for them and return a mirror object.
Something like that -
let mirroredObj = Mirror(reflecting: User())
for (index, property) in mirroredObj.children.enumerate() {
property.value = <SOME_VALUE>
}
return mirroredObj
Or maybe a completely different approach to this?
source
share