This project aims to provide a rich, class-based enum for Objective-C. This allows you to implement polymorphic behaviour per-state and apply categories to the enum type.
Given we have a defined enum, we can perform things like this:
for(id enumValue in [ActivityEnum enumValues]) {
NSLog(@"enum name %@", [enumValue name]);
}
ActivityEnum *e = [ActivityEnum enumForName:@"CYCLING"];
ActivtyEnum *e = [ActivityEnum enumForOrdinal:0];
// Note that this is not necessarily the order in which the enum values are defined!
[ActivtyEnum.CYCLING numberOfCaloriesAfterTime:125];
Please take a look at ActivityEnum.h and ActivityEnum.m in the example project.