The issue here may be that #keyPath
makes sure that all parts of the key path are @objc
accessible. I.e.:
class Object {
var integerProperty: Int64 = 0
}
#keyPath(Object.integerProperty) // error: argument of '#keyPath' refers to non-'@objc' property 'integerProperty'
Hence using Swift keypaths in this context is IMHO quite dangerous as it would allow non-@objc
properties to be referrenced in the predicates (and not just them) resulting in runtime crashes which is exactly what you're trying to avoid...