[swift-corelibs-dev] KVC dependent classes

Brent Royal-Gordon brent at architechies.com
Wed Mar 16 18:12:27 CDT 2016


> Sorry, I said NSProgress but I meant NSPredicate. I personally can't even imagine what a alternative API for NSPredicate would look like 🤔

Use reflection.

Match against only dictionaries with string keys.

Match against only objects conforming to some dictionary-with-string-keys-like protocol.

Match against only objects conforming to an NSKeyValueCoding protocol with a `value(forKey:)` requirement.

Don't actually implement matching; just use it as an abstraction for things like CloudKit and Core Data.

There are options.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-corelibs-dev mailing list