Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ainame/ameenumeratedobject
[deprecated] AMEEnumeratedObject provide defining method to create a enum object as a plain old objc object.
https://github.com/ainame/ameenumeratedobject
Last synced: about 2 months ago
JSON representation
[deprecated] AMEEnumeratedObject provide defining method to create a enum object as a plain old objc object.
- Host: GitHub
- URL: https://github.com/ainame/ameenumeratedobject
- Owner: ainame
- License: mit
- Created: 2014-07-03T16:55:39.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-13T23:40:20.000Z (over 10 years ago)
- Last Synced: 2024-05-01T19:26:46.418Z (8 months ago)
- Language: Objective-C
- Homepage:
- Size: 195 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AMEEnumeratedObject
[![CI Status](http://img.shields.io/travis/ainame/AMEEnumeratedObject.svg?style=flat)](https://travis-ci.org/ainame/AMEEnumeratedObject)
[![Version](https://img.shields.io/cocoapods/v/AMEEnumeratedObject.svg?style=flat)](http://cocoadocs.org/docsets/AMEEnumeratedObject)
[![License](https://img.shields.io/cocoapods/l/AMEEnumeratedObject.svg?style=flat)](http://cocoadocs.org/docsets/AMEEnumeratedObject)
[![Platform](https://img.shields.io/cocoapods/p/AMEEnumeratedObject.svg?style=flat)](http://cocoadocs.org/docsets/AMEEnumeratedObject)## Usage
```objc
@interface Alphabets : AMEEnumeratCollection; @end
@interface Alphabet : AMEEnumeratedObject
+ (Alphabet *)enumObject;
@end;
@implementation Alphabet; @end
@interface A : Alphabet; @end; @implementation A; @end
@interface B : Alphabet; @end; @implementation B; @end
@interface C : Alphabet; @end; @implementation C; @end@implementation Alphabets
+ (NSArray *) values
{
return @[
[A defineEnum:0 name:@"a" description:@"えー"],
[B defineEnum:1 name:@"b" description:@"びー"],
[C defineEnum:2 name:@"c" description:@"しー"],
];
}
@end// ....
[AMEEnumeratedObjectInitializer initializeAllEnumerateObjects];
Alphabet *alphabet = [A enumObject];
alphabet.ordinal; //=> 0
alphabet.name; //=> @"a"
alphabet.description; //=> @"えー"alphabet = [Alphabets valueForName:@"b"] // => B object;
[Alphabets values] // => A, B and c instances as NSArray;
```## Requirements
## Installation
AMEEnumeratedObject is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:pod "AMEEnumeratedObject"
## Author
[ainame](https://twitter.com/ainame)
## License
AMEEnumeratedObject is available under the MIT license. See the LICENSE file for more info.