When presenting text to users, it's often convenient to be able to automatically switch between singular and plural forms of words. InflectorKit from Mattt Thompson helps you do that.
Sample code included:
#import "NSString+InflectorKit.h"
for (NSString *singular in @[@"person", @"tomato", @"matrix", @"octopus", @"fish"]) {
NSLog(@"%@: %@", singular, [singular pluralizedString]);
}
or:
for (NSString *plural in @[@"people", @"tomatoes", @"matrices", @"octopi", @"fish"]) {
NSLog(@"%@: %@", plural, [plural singularizedString]);
}
Your feedback is valuable: Do you want more nuggets like this? Yes or No
.
.