GithubHelp home page GithubHelp logo

feature-flag-demo's Introduction

#Feature Toggling Demo

A quick demo app to help compare different approaches to feature toggling. Includes demos for:

  1. Build time
  2. Run time (including overriding from user defaults)

##Common setup

The project uses FeaturesDebug.xcconfig as its configuration. This file imports the cocoapods config files so everything from pods should be passed through. There are ruby gems to modify these files but the setup here is fairly simple text so can get away with basic scripts as well.

##Build time

Swift can have other flags set with "-D " in OTHER_SWIFT_FLAGS (same way we setup DEBUG) now. The config here adds BUILD_TIME_FEATURE to existing flags

At point of use the code can be compiled in or out using #if <FEATURE_NAME> ... #endif. This can be nice because it means code thats not ready for wider use can not be enabled at runtime, but gets a little repetitive if there is no obvious place to cut out the code. It would be nice to use @available here for a class and have swift enforce its use but it doesnt seem to work within compilation directives

##Run time

Pretty similar to the other example except it uses user-defined build values and Info.plist settings to expose via runtime instead of build. There is a simple function to check the info dictionary from bundle for matching strings

Point of use here is a function to check Info.plist (or helper vars to clean it up). Can also be overriden in user defaults (or remotely as well if we want to do that)

feature-flag-demo's People

Contributors

timothychilvers avatar wattson12 avatar

Watchers

 avatar  avatar  avatar

Forkers

timothychilvers

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.