Question

I'm facing some scaling challenges at the company I work for and I would like to have new features implemented with an off switch so that if the feature is not ready to ship we can turn it off and have it ready for the next release. I know Facebook, Twitter, Podio and probably other companies have this. The easiest way I can think of would be to embed the code in a #ifdef - #endif block but I would like to have an internal settings panel when I can turn features on and off at runtime which would be more easy to test. Any ideas how something like that could be implemented? Any suggestions are very much appreciated. Thanks

Was it helpful?

Solution

Store your configuration as a plist on a server. When the app opens, download the plist, unpack it and store the contents into user defaults. For each feature which may be turned off, check user defaults to see if it is before enabling access to it.

For simplicity, use registerDefaults to enable all features and use the download only to disable features.

OTHER TIPS

Try saving such settings in NSUserDefaults - so they can persist as well as easy to access https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/nsuserdefaults_Class/Reference/Reference.html

you can save set flag for each feature as setting in NSUserDefaults so whenever user try to open that feature by comparing flag status (enables/disabled) you can show user that feature or alert (this is pending for next release or so...)

Hope it helps !

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top