RBEnum Class Reference
Inherits from | NSObject |
---|---|
Declared in | RBEnum.h |
+ registerEnumerationType:withMapping:allowCombinations:
Register the string mappings to an enumeration type.
+ (void)registerEnumerationType:(nonnull NSString *)enumerationTypeName withMapping:(nonnull NSDictionary<NSString*,NSNumber*> *)mapping allowCombinations:(BOOL)combinations
Parameters
enumerationTypeName |
The name of the enumeration type. |
---|---|
mapping |
The string to value mapping for the enumeration. Note mapping keys are lowercased. |
combinations |
Indicates that the mapping values maybe combined e.g. “top | left” which will be converted to UIRectEdgeTop | UIRectEdgeLeft. |
Discussion
Register the string mappings to an enumeration type.
Declared In
RBEnum.h
+ stringWithValue:forEnumerationType:
Retrieve the string of the given enumeration value.
+ (nullable NSString *)stringWithValue:(NSInteger)value forEnumerationType:(nonnull NSString *)enumerationTypeName
Parameters
value |
The enumeration value to get the string for. |
---|---|
enumerationTypeName |
The name of the enumeration type. |
Return Value
The string value.
Discussion
Retrieve the string of the given enumeration value.
Declared In
RBEnum.h
+ valueWithString:forEnumerationType:
Retrieve the value of the given enumeration string.
+ (NSInteger)valueWithString:(nonnull NSString *)string forEnumerationType:(nonnull NSString *)enumerationTypeName
Parameters
string |
The enumeration string to get the value for. |
---|---|
enumerationTypeName |
The name of the enumeration type. |
Return Value
The value.
Discussion
Retrieve the value of the given enumeration string.
Declared In
RBEnum.h
+ stringsForEnumerationType:
Retrieves the set of mapped enumeration strings for the given type name.
+ (nullable NSSet *)stringsForEnumerationType:(nonnull NSString *)enumerationTypeName
Parameters
enumerationTypeName |
The name of the enumeration type. |
---|
Return Value
The NSSet
of strings.
Discussion
Retrieves the set of mapped enumeration strings for the given type name.
Declared In
RBEnum.h
+ enumerationTypeAllowsCombinations:
Retrieves the flag determining that this enumeration can be combined.
+ (BOOL)enumerationTypeAllowsCombinations:(nonnull NSString *)enumerationTypeName
Parameters
enumerationTypeName |
The name of the enumeration type. |
---|
Return Value
YES
if the enumaration allows combinations.
Discussion
Retrieves the flag determining that this enumeration can be combined.
Declared In
RBEnum.h