Skip to content

n-b/ObjcCollectionsKeyValueFiltering

Repository files navigation

NSArray and NSSet categories for Key-Value filtering

Demo time :

// Quick and easy search
NSArray * employees = [...]
Person * ceo = [employees firstObjectWithValue:@"[email protected]" forKeyPath:@"email"];

// Keypaths
Person * steve = [employees firstObjectWithValue:[NSNull null] forKeyPath:@"car.licenseplate"]

// Keypath collection operators
NSArray * boxes = [...]
NSArray * emptyBoxes = [boxes filteredArrayWithValue:@0 forKey:@"items.@count"];

More details on my blog.

About

NSArray and NSSet additions for Key-Value filtering

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published