A macro and functions that add reflection capabilities to enumerations in Objective-C.
ReflectableEnum is a library that adds reflection capabilities to enumerations in Objective-C. It solves common problems like converting enum values to strings, iterating over all enum members, and finding min/max values—functionality not natively available in Objective-C.
Objective-C developers working on iOS or macOS apps who need better introspection and debugging support for enumerations.
It provides a simple, macro-based approach to enum reflection without runtime overhead, auto-generating type-specific functions for ease of use and reducing boilerplate code.
Reflection for enumerations in Objective-C.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automates enum-to-string conversion using the REFLECTABLE_ENUM macro, eliminating manual switch-case statements and addressing common StackOverflow pain points.
Provides REFAllValuesForEnumWithMember to retrieve all enum values as an array, enabling easy iteration and validation in Objective-C.
Offers REFMinForEnumWithMember and REFMaxForEnumWithMember to automatically find integer bounds, useful for range checks without manual tracking.
Supports REFMemberForString to map string names back to enum members, aiding in parsing or configuration scenarios.
Auto-generates functions like REFStringForMemberInAccountType to avoid casting hassles, improving type safety and code clarity.
The README explicitly states that string conversion functions fail for enums with duplicated or self-referencing members, limiting its use in certain enum designs.
Cannot be applied to enums already defined in frameworks or libraries, restricting adoption in projects with pre-defined enums.
Using general functions like REFStringForMember requires explicit casting, which can be error-prone until type-specific functions are generated.
Tied to Objective-C and lacks Swift compatibility, making it irrelevant for modern iOS/macOS projects transitioning to Swift.