Closed ngs closed 8 years ago
Hi @ngs , First of all, thanks for the PR.
The reason why we are not mirroring the properties that are objects at the moment is because that could lead in an endless loop.
Imagine something like this:
Task <---------> User
if you mirror the task, it is going to mirror the user, and that mirroring is going to mirror the task...
@poolqf Thank you for your feedback.
I created this PR because getMirror
caused crashing by accessing valueForKey
with key contained in ignoredProperties()
.
How do you think about skipping values by checking ignoredProperties()
?
let ignoredProperties = (self.dynamicType as Object.Type).ignoredProperties()
// and inside loop
guard let key = c.1.0
where !key.hasSuffix(".storage") && !ignoredProperties.contains(key) else { continue }
Without a deeper look, I find it is correct @ngs , but only for users that don't use this ignored properties
Maybe this should something that the user should be able to enable or not. There could be the case where the user wants to use this ignored properties...
Okay, I'll implement base class to override getMirror
, thanks :bow:
Updated
getMirror
to iterate properties with scheme properties