Closed ManueGE closed 3 years ago
Hi @ManueGE,
Thanks for your contribution. It seems a useful feature to have. My concern with the implementation is the use of an extension, rather than a protocol. Is there any special reason you chose to do it that way?
No, there is not a reason for that. I also thought about adding it as a protocol, but I finally decided to do it as an extension. I can switch it to a protocol if it sounds better for you.
Any idea about the name of that protocol? Maybe GrootCustomInsertable
and a method called postInsert
?
The changes contained on this PR add the ability to modify an object after being inserted/update using Groot in a consistent way.
It just adds a category to
NSManagedObject
with the methodgrt_awakeFromInsert
that is called after each insert/update operation. This method can be overridden by any subclass.This is a possible solution for the issue described in #93 .
If you like the idea but you want me to change something let me know.