Latest 0.0.5
Homepage https://github.com/fetch/swift-configurations
License LICENSE
Platforms ios 8.0, osx 10.9, tvos 9.0, watchos 2.0, requires ARC
Authors

Simple Swift library for plist based configuration

Installation

Add a line to your Podfile:

pod 'Configurations'

Add 2 keys to your applications Info.plist, one for the name of your configurations plist (ConfigurationFileName) and one for the current configuration (Configuration).

Configurations

If you set Configuration to $(CONFIGURATION), it will inherit the current application configuration.

Usage

Create a plist with a dictionary containing dictionaries for the different configuration names, below them you’re free to add whatever you want:

Configurations

Retrieve a value from the current configuration:

Import the framework:

import Configurations

And get the default configuration:

let configuration = Configuration.defaultConfiguration()
if let someValue = configuration["someKey"] as? String {
    print("someKey: (someValue)")
}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Latest podspec

{
    "name": "Configurations",
    "version": "0.0.5",
    "summary": "A super minimal configuration framework in Swift.",
    "description": "Easily define different configuration values per application configuration using a single plist.",
    "homepage": "https://github.com/fetch/swift-configurations",
    "license": "LICENSE",
    "authors": {
        "Koen Punt": "[email protected]"
    },
    "social_media_url": "https://twitter.com/fetch",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "tvos": "9.0",
        "watchos": "2.0"
    },
    "source": {
        "git": "https://github.com/fetch/swift-configurations.git",
        "tag": "v0.0.5"
    },
    "source_files": "Configurations",
    "requires_arc": true,
    "swift_version": "3"
}

Pin It on Pinterest

Share This