GithubHelp home page GithubHelp logo

db5's Introduction

DB5

by Q Branch

App Configuration via Plist

By storing colors, fonts, numbers, booleans, and so on in a plist, we were able to iterate quickly on our app Vesper.

Our designers could easily make changes without having to dive into the code or ask engineering to spend time nudging pixels and changing values.

There is nothing magical about the code or the system: it’s some simple code plus a few conventions.

How it works

See the demo app. You include two classes — VSThemeLoader and VSTheme — and DB5.plist. The plist is where you set values.

At startup you load the file via VSThemeLoader, then access values via methods in VSTheme.

VSTheme methods

Most of the methods are straightforward. -[VSTheme boolForKey:] returns a BOOL, and so on.

Some of the methods require multiple values in the plist file. For instance, -[VSTheme fontForKey:] expects the font name as keyName and the size as keyNameSize. See VSTheme.h for more information about these multiple-key values.

Inheritance

Though we haven’t used this capability in Vesper, we made it so that you can have multiple themes. Every theme inherits from the Default theme.

If you ask for a value from a theme other than Default, and that value is not specified in that theme, it falls back to Default to get that value.

Demo app

The demo app is straightforward and small. DB5AppDelegate loads the themes. DB5ViewController shows some example use.

Also, see the Examples folder for the DB5.plist from Vesper.

Contact

Brent Simmons
@brentsimmons

License

DB5 is available under the MIT license. See the LICENSE file for details.

db5's People

Contributors

brentsimmons avatar dwiskus avatar nap01234 avatar ierceg avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.