M5Enum 1.1.1

M5Enum 1.1.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Sep 2015

Maintained by Mathew Huusko V.



M5Enum 1.1.1

Objective-C macro to wrap enum defines – generates inline function to lookup string/name for enum value.

Usage

RAMEnum(Usefulness,
    typedef NS_ENUM(NSUInteger, Usefulness) {
        kUsefulnessUseful,
        kUsefulnessVeryUseful ,
        kUsefulnessSuperUseful,
        kUsefulnessUseless
    }
);

...
...

Usefulness someUsefulness = kUsefulnessVeryUseful;

NSLog(@"Usefulness: %@", UsefulnessName(someUsefulness)); //"Usefulness: kUsefulnessVeryUseful"