Boolean

Bool properties must be either true or false. The default value of a Bool property is false. You can change the default value of the property by assigning a new value in an overridden reset method.

Local properties

Switch UI

Allows a boolean property to be changed in Appfigurate using a switch.

Swift prototype

@BoolProperty(description, restart)
var propertyName: Bool

If restart is true, then the app will be restarted if the property value changes.

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {
    
    @BoolProperty(description: "Enable debug logging to console", restart: false)
    var logging: Bool
    
    override func reset() {
        logging = true
    }
    ...

Remote properties

Remote Switch UI

Allows a third party remote configuration provider's boolean property to be changed locally in Appfigurate using a switch. If the override tick box is ticked off, the third party remote configuration provider's value is displayed. If the override tick box is ticked on, then you can use Appfigurate to locally override the value.

Swift prototype

@RemoteBoolProperty(remoteKey, description)
var propertyName: Bool

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {
    
    @RemoteBoolProperty(remoteKey: "alwaysDarkMode", description: "Force dark mode to be always set")
    var alwaysDarkMode: Bool
    
    override func reset() {
        alwaysDarkMode = false
    }
    ...

Last updated