I’m trying to use Marshal on Linux, and I’ve run into an issue where it won’t build, I think because it’s relying on NSObject.value(forKeyPath:). I suppose one solution would be to simply provide an implementation of this method in the MarshalDictionary class that calls it, no?
Can Swift’s key paths be used to navigate a JSON object?
The ‘key path’ being referred to in this method is not a Swift keypath, it’s the Objective-C definition of Key-Value Coding shining through. KVC and KVO isn’t available on Linux as it uses the Objective-C runtime.
Hmm, that keypath seems clunkier than I would have hoped, but I guess I'm not really understanding how Swift key paths really work.
In any case, my main problem is the apparent lack of value(forKeyPath:) in Linux. Oh, actually, looking at the Marshal code again, I realize this is an extension on NSDictionary that’s using this, and maybe I can just exclude that bit for Linux builds.