Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/segiddins/segmodules
A library to bring modules/mixins/concrete protocols to Objective-C.
https://github.com/segiddins/segmodules
Last synced: 25 days ago
JSON representation
A library to bring modules/mixins/concrete protocols to Objective-C.
- Host: GitHub
- URL: https://github.com/segiddins/segmodules
- Owner: segiddins
- License: mit
- Created: 2014-01-25T00:46:07.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-02T17:48:08.000Z (about 10 years ago)
- Last Synced: 2024-10-07T12:32:42.456Z (30 days ago)
- Language: Objective-C
- Homepage:
- Size: 180 KB
- Stars: 12
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# SEGModules
[![Version](https://cocoapod-badges.herokuapp.com/v/SEGModules/badge.png)](http://cocoadocs.org/docsets/SEGModules)
[![Platform](https://cocoapod-badges.herokuapp.com/p/SEGModules/badge.png)](http://cocoadocs.org/docsets/SEGModules)## Usage
To create a module, declare a protocol with all of the methods of the module. Then, subclass `SEGModule` with the same name as your module's protocol, declare your subclass as adopting the protocol, and implement all the methods in the protocol. (Note: you cannot access ivars in any way, so if you need any properties, you should store them as associated objects on `self`.) For each class you wish to include the module, just declare that class as conforming to the module's protocol (you can even do this on the declaration of a category or class extension). The rest of the work will be done automatically upon the initialization of the runtime.
> A class should be used for functionality that will require instantiation or that needs to keep track of state. A module can be used either as a way to mix functionality into multiple classes, or as a way to provide one-off features that don't need to be instantiated or to keep track of state.
[Jimmy Cuadra (on SO)](http://stackoverflow.com/a/2671706/1675979)To run the example project; clone the repo, and run `pod install` from the Project directory first.
## Requirements
## Installation
SEGModules is available through [CocoaPods](http://cocoapods.org), to install
it simply add the following line to your Podfile:pod "SEGModules"
## Author
Samuel E. Giddins, [email protected]
## License
SEGModules is available under the MIT license. See the LICENSE file for more info.