Links
Comment on page

Boolean

Objective-C (iOS, watchOS)

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

BOOL switch interface

BOOL properties should be declared in your APLConfiguration subclass header file as follows:
@property(assign) BOOL propertyName;

BOOL switch implementation

BOOL_PROPERTY(propertyName, description, restart)
Allows the BOOL property to be changed in Appfigurate using a switch. If restart is YES, then the app will be restarted if the property value changes.
Objective-C example
@import AppfigurateLibrary;
@interface Configuration : APLConfiguration
@property(nonatomic, assign) BOOL logging;
@end
@implementation Configuration
BOOL_PROPERTY(logging, @"Enable debug logging to console", NO);
...
Appfigurate UI element example

Swift (iOS, watchOS)

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.

Bool switch implementation

@BoolProperty(description, restart)
var propertyName: Bool
Allows the Bool property to be changed in Appfigurate using a switch. 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
...
Appfigurate UI element example

Java (Android)

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

boolean switch implementation

@BooleanProperty(description, restart)
public boolean propertyName;
Allows the boolean property to be changed in Appfigurate using a switch. If restart is true, then the app will be restarted if the property value changes.
Java example
import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.BooleanProperty;
public class AppConfiguration extends Configuration {
@BooleanProperty(description = "Enable debug logging to console", restart = false)
public boolean logging;
...
Appfigurate UI element example

Kotlin (Android)

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

Boolean switch implementation

@BooleanProperty(description, restart)
var propertyName = false
Allows the Boolean property to be changed in Appfigurate using a switch. If restart is true, then the app will be restarted if the property value changes.
Kotlin example
import nz.co.electricbolt.appfiguratelibrary.Configuration
import nz.co.electricbolt.appfiguratelibrary.annotations.BooleanProperty
public class AppConfiguration : Configuration() {
@BooleanProperty(description = "Enable debug logging to console", restart = false)
var logging = false
...
Appfigurate UI element example

Dart (Flutter for iOS, Flutter for Android)

The flutter APLNativeConfiguration class defers to the underlying platform APLConfiguration (iOS) or nz.co.electricbolt.appfiguratelibrary.Configuration (Android) subclass to read property values.

bool implementation

bool get propertyName => nativeBool('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
bool get logging => nativeBool('logging');
...