Latest 0.1.0
Homepage https://github.com/Nimbleworks/NIMConfigManager
License MIT
Platforms ios 7.0, requires ARC
Authors

Version
Platform
Build Status

Usage

To use create a category of NIMConfigManager, such as NIMConfigManager+myApp. We create dynamic acessors for each of the properties in your config.plist. For an example look at NIMConfigManager+Example.m and exampleConfig.plist.

If your config plist contains in the following:

    <key>labelText</key>
    <string>Hello World!</string>
    <key>hideBigButton</key>
    <true/>

Our NIMConfigManager+myApp.h would look like:

    @interface NIMConfigManager (myApp)

    @property(readonly)NSString* labelText;
    @property(readonly)BOOL hideBigButton;

    @end

And the NIMConfigManager+myApp.m would be:

    @implementation NIMConfigManager (myApp)

    @dynamic labelText;
    @dynamic hideBigButton;

    @end

Usage is pretty simple, we include the category and initialise the sharedManager, after pass it our config.plist file.

    NIMConfigManager *manager = [NIMConfigManager sharedManager];
    manager.configPlist = [NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle]
                                                                      pathForResource:@"config"
                                                                      ofType:@"plist"]];

Accessing any of the properties we need is as simple as:

    manager.labelText;

Important Notes

Currently this manager supports all native plist types, excluding NSDictionaries.

Requirements

NIMConfigManager has no external requirements.

Installation

NIMConfigManager is available through CocoaPods, to install
it simply add the following line to your Podfile:

pod "NIMConfigManager"

Credits

Big thanks to Amy Worrall for her talk at iOSConfUK. All of the clever code in this has been ripped studiously from her presentation slides.

Author

John Nye, @john_nye

License

NIMConfigManager is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NIMConfigManager",
    "version": "0.1.0",
    "summary": "A simple solution for managing configuration details within your applications, ideal for templateable apps. ",
    "description": "                       Creates a singleton for accessing configuration details for your applications. Based extensively on a talk at iOSConfUK by Amy Worral.nn                       Ideally used in situations where you need more then one target from a single codebase you can use the config.plist to activate features and configure style.nn",
    "homepage": "https://github.com/Nimbleworks/NIMConfigManager",
    "license": "MIT",
    "authors": {
        "John Nye": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Nimbleworks/NIMConfigManager.git",
        "tag": "0.1.0"
    },
    "social_media_url": "https://twitter.com/nimbleworks",
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "NIMConfigManager",
    "ios": {
        "exclude_files": "Classes/osx"
    },
    "osx": {
        "exclude_files": "Classes/ios"
    }
}

Pin It on Pinterest

Share This