I'm trying to put entities in a Core Data store that each have non-standard data types - one is an NSDocument and the other is an NSURL. I get that within the .xcdatamodeld I need to declare them as Transformable. And I think I need to add something that implements NSValueTransformer to turn them into NSData (... or is there a default transformer that will do that automatically?)
I think the question should be simple to answer: where do I implement it? I haven't found an explicit example of doing this in Swift. There's an Objective-C example but the separation of .h and .m files makes it unclear to me where this would go in Swift.
Suppose I have an entity type called Notebook with an attribute called folderURL - of type Transformable in the database, and of type NSURL in the actual variable. (I'm using that as the example because it's the simpler one - please don't tell me to just convert the NSURL to a String, because that won't work for the other Transformable.)
Question is: where do I put the NSValueTransformer for folderURL, assuming that I need one? Should Notebook implement it? Should Notebook+CoreDataProperties? Or do I need a separate subclass called FolderURL that implements it, and if so, how do I refer to that subclass back in Notebook (and/or Notebook+CoreDataProperties)?
(There was an earlier question with a similar title but they seem to have got a bit further than this already - they're not asking or demonstrating about the "where".)