MFEnvironmentWatcher 0.1.0

MFEnvironmentWatcher 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Feb 2017

Maintained by Jiangling Zheng.



  • By
  • Jiangling Zheng

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Usage

  1. Add Settings.bundle and MFEnvironmentConfig.plist to your project just like the example project.

  2. [Optional] Add your custom property to MFEnvironmentConfig.plist and add the correspoding category to the MFEnvironmentConfig class.

  3. Run settings_buddy.rb script in release build to remove the environment option from settings menu.

    e.g. Add below codes to the Build Phases, you can also replace the DEBUG macro with other macro.

    do_remove = 1
    if [ "$DEBUG" == "true" ]; then
       do_remove = 0
    fi
    
    if [ $do_remove -eq 1 ]; then
       ${SOURCE_ROOT}/path/to/settings_buddy.rb -s "${SOURCE_ROOT}" -i "kMFUserDefaultsCurrentEnvironment"
    fi
  4. Switch environment in the system settings menu, the watcher will abort app and apply the correspoding config when detect the change.

Installation

MFEnvironmentWatcher is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "MFEnvironmentWatcher"

Author

[email protected]

License

MFEnvironmentWatcher is available under the MIT license. See the LICENSE file for more info.