CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Jun 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by Eugene Yagrushkin.
App Configuration via Plist, inspired by original DB5 library and https://github.com/tombenner/nui
by Eugene(https://jeksys.github.io/)
Add plist file to your project or copy a demo file from the demo project.
Add keys and values to your plist file
var themeLoader = DB6ThemeLoader(themeFilename: "DB6Demo")
var theme = DB6Theme.default
let stringKey = "string"
let stringValue = theme?.string(key: stringKey)
let key="integer"
let value = theme?.integer(key: key)
let key="float"
let value = theme?.float(key: key)
let key="double"
let value = theme?.double(key: key)
let key="boolean"
let value = theme?.bool(key: key)
let key = "colorHex"
let value = theme?.color(key: key)
The theme manager allows you to read not only values from the plist file, but also use references for another values. A reference starts with @ symbol. If the there is not such key in the dictionary the reference string will be returned.
You can style your UI controls with a dictionary in plist file. See the demo project.
You add multiple styles in the Interface Builder. There is “style” custom attribute. Or you can do it programmatically.
let style = "loginbutton"
let button = UIButton()
theme.update(button: button, key: style)
You can find a demo app, which explain how the library works via some sample code and unit tests.
Just add the Classes folder to your project.
DB6 is available under the MIT license. See the LICENSE file for details.