Environment tags

Environment tags provide a quick and easy way to change multiple configuration properties at the same time. Environment tags are optional and can be specified in any List or Editable List configuration properties, in the key of any key-value pairs.

For example, you may have the following development environments: DEV, TEST, PVT (and Production which would be the default reset state of the app). Environment tags in the key of key-value pairs are not case sensitive, but we recommend using uppercase. Environment tags are wrapped in { } characters.

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {

    @IntPropertyList(description: "Quality rating", restart: false, values: [
        "{DEV,TEST}Low": 10, 
        "{PVT}Average": 50, 
        "Excellent": 95
    ])
    var rating: Int
    
    override func environmentTags() -> [String] {
        return ["Dev", "Test", "PVT"]
    }
    
    override func reset() {
        rating = 10
    }
    ...

The list returned by the environmentTags method is used for validation of key usage on startup of your app, and to display the list of environment tags in the UI, in the order and casing specified:

iOS
Android

Tapping any of the segments in Appfigurate will automatically change all of the List or Editable List configuration properties to the appropriate value.

If you change any List or Editable List value to a conflicting value (e.g. you had selected PVT, but have now selected a single List value that is marked as DEV), then Appfigurate will deselect any highlighted segment:

iOS
Android

Last updated