https://github.com/fetch/swift-configurations
Simple Swift library for plist based configuration
https://github.com/fetch/swift-configurations
Last synced: 12 months ago
JSON representation
Simple Swift library for plist based configuration
- Host: GitHub
- URL: https://github.com/fetch/swift-configurations
- Owner: fetch
- License: mit
- Created: 2016-01-26T13:31:51.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-08-18T15:44:57.000Z (over 6 years ago)
- Last Synced: 2025-03-29T00:51:16.085Z (about 1 year ago)
- Language: Swift
- Homepage: https://cocoapods.org/pods/Configurations
- Size: 32.2 KB
- Stars: 7
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Configurations
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`).

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:

### Retrieve a value from the current configuration:
Import the framework:
```swift
import Configurations
```
And get the default configuration:
```swift
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