Appfigurate™️
HomeDocumentation
  • Introducing Appfigurate™️ 3
  • Getting Started
    • Getting Started
    • Examples
    • Upgrade guide
      • v1.4.0 to v2.2.0
      • v2.1.1 to v2.2.0
      • v2.2.1 to v3.0.0
      • v3.2.1 to v4.0.0
    • iOS native app integration
      • iOS app extension integration
    • watchOS app integration
      • watchOS app extension integration
    • Android native app integration
    • Mobile Flutter integration
      • Flutter iOS
      • Flutter Android
    • React Native integration
      • iOS native module integration
      • Android native module integration
      • JavaScript integration
    • Third party remote configuration providers
      • Firebase Remote Config
      • Launch Darkly
      • Other third party remote configuration providers
  • Configuration subclasses
    • Supported property types
      • Boolean
      • Integer
      • Float
      • Double
      • Plain String
      • Encrypted String
    • Custom executable actions
    • Slider icon types
  • Additional reading
    • Info.plist options
    • AndroidManifest.xml options
    • Displaying overridden configuration
    • Security
      • Best practice
      • Encryption
      • Export compliance
      • App Store compliance
      • PrivacyInfo.xcprivacy
      • Rotating your private key
  • Automation testing
    • iOS native app automation testing
    • Android native automation testing
  • API
    • iOS and watchOS API
    • Android API
    • Mobile Flutter API
    • React Native API
  • Appfigurate User Guide
    • Introduction
    • Main menu
    • Select app
    • Add app
    • Import app
    • Install example apps
    • Settings
      • Passcode Lock
      • Restore
      • Backup
      • Delete all apps and Settings
      • Analytics
    • Edit app
    • Configure app
    • Permissions
  • Appfigurate SE user guide
    • Introduction
    • Manual encryption
      • ENCRYPTED_STRING macro/function
      • ENCRYPTED_STRING_IOS_WATCHOS macro/function
    • Setup iOS Simulator app
    • Setup Android Emulator app
    • Xcode source editor extension
      • Troubleshooting
    • Real device cloud testing services
      • BrowserStack
  • LEGAL
    • License Agreement
    • Privacy Policy
    • Release History
    • Third party notices
Powered by GitBook
On this page
  • Local properties
  • Slider UI
  • Editable UI
  • List UI
  • Editable List UI
  1. Configuration subclasses
  2. Supported property types

Float

PreviousIntegerNextDouble

Last updated 4 months ago

Float is a single-precision 4 byte floating-point type with an approximate range of 1.2E-38 to 3.4E+38.

The default value of a Float is 0.0. You can change the default value of the property by assigning a new value in an overridden method.

float is a single-precision 4 byte floating-point type with an approximate range of 1.2E-38 to 3.4E+38.

The default value of a float is 0.0. You can change the default value of the property by assigning a new value in an overridden method.

float properties should be declared in your subclass header file as follows:

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

@property(nonatomic, assign) float propertyName;
...

Float is a single-precision 4 byte floating-point type with an approximate range of 1.2E-38 to 3.4E+38.

The default value of a Float is 0.0f. You can change the default value of the property by assigning a new value in an overridden method.

float is a single-precision 4 byte floating-point type with an approximate range of 1.2E-38 to 3.4E+38.

The default value of a float is 0.0f. You can change the default value of the property by assigning a new value in an overridden method.

The flutter class defers to the underlying platform (iOS) or (Android) subclass to read property values.

As Dart doesn't have a single-precision float data type, you should map to a double-precision double data type instead:

Dart property type
Swift property type
Objective-C property type
Kotlin property type
Java property type

double

Float

float

Float

float

Local properties

Slider UI

Allows a float property to be changed in Appfigurate using a slider between minimum and maximum values.

Swift prototype

@FloatPropertySlider(min, max, icon, description, restart)
var propertyName: Float

You can customize the minimum and maximum images using the parameter. If restart is true, then the app will be restarted if the property value changes.

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {

    @FloatPropertySlider(min: 60.5, max: 120.41, icon: .volume, description: "Clipping - decibels", restart: false)
    var maxDecibel: Float
    
    override func reset() {
        maxDecibel = 100.0
    }
    ...

Objective-C Prototype

FLOAT_PROPERTY_SLIDER(propertyName, minValue, maxValue, icon, description, restart)

You can customize the minimum and maximum images using the parameter. 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) float maxDecibel;

@end

@implementation Configuration

FLOAT_PROPERTY_SLIDER(maxDecibel, 60.5, 120.41, APLIconSliderVolume, @"Clipping - decibels", NO);

- (void) reset {
    self.maxDecibel = 100.0;
}
...

Kotlin prototype

@FloatPropertySlider(description, minValue, maxValue, sliderIcon, restart)
var propertyName = 0.0f

Kotlin example

import nz.co.electricbolt.appfiguratelibrary.Configuration
import nz.co.electricbolt.appfiguratelibrary.annotations.FloatPropertySlider
import nz.co.electricbolt.appfiguratelibrary.annotations.IconSlider

class AppConfiguration : Configuration() {

    @FloatPropertySlider(minValue = 60.5f, max = 120.41f, sliderIcon = IconSlider.IconSliderVolume, description = "Clipping - decibels", restart = false)
    var maxDecibel = 0.0f
    
    override fun reset() {
        super.reset()
        maxDecibel = 100.0f
    }
    ...

Java prototype

@FloatPropertySlider(description, minValue, maxValue, sliderIcon, restart)
float propertyName;

Java example

import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.FloatPropertySlider;
import nz.co.electricbolt.appfiguratelibrary.annotations.IconSlider;

public class AppConfiguration extends Configuration {

    @FloatPropertySlider(minValue = 60.5f, max = 120.41f, sliderIcon = IconSlider.IconSliderVolume, description = "Clipping - decibels", restart = false)
    public float maxDecibel;
    
    @Override
    public void reset() {
        super.reset();
        this.maxDecibel = 100.0f;
    }
    ...

Dart prototype

double get propertyName => nativeDouble('propertyName');

Dart example

import 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    double get maxDecibel => nativeDouble('maxDecibel');
    ...

JavaScript example

import {
  NativeModules,
} from 'react-native';

const {Appfigurate} = NativeModules;

...

let maxDecibel = await Appfigurate.nativeValue("maxDecibel"); // Number

Editable UI

Allows a float property to be changed in Appfigurate using a text field between minimum and maximum values, and an optional regular expression validating input.

Swift prototype

@FloatPropertyEdit(min, max, regex, description, restart)
var propertyName: Float

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

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {

    @FloatPropertyEdit(min: -2.1, max: 4.1, regex: "", description: "Shot accuracy", restart: false)
    var shotAccuracy: Float
    
    override func reset() {
        shotAccuracy = 3.241
    }
    ...

Objective-C prototype

FLOAT_PROPERTY_EDIT(propertyName, minValue, maxValue, regex, description, restart)

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) float shotAccuracy;

@end

@implementation Configuration

FLOAT_PROPERTY_EDIT(shotAccuracy, -2.1, 4.1, @"", @"Shot accuracy", NO);

- (void) reset {
    self.shotAccuracy = 3.241;
}
...

Kotlin prototype

@FloatPropertyEdit(description, minValue, maxValue, regularExpression, restart)
var propertyName = 0.0f

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.FloatPropertyEdit

class AppConfiguration : Configuration() {

    @FloatPropertyEdit(description = "Shot accuracy", minValue = -2.1f, maxValue = 4.1f, regularExpression = "", restart = false)
    var shotAccuracy = 0.0f
    
    override fun reset() {
        super.reset()
        shotAccuracy = 3.241f
    }
    ...

Java prototype

@FloatPropertyEdit(description, minValue, maxValue, regularExpression, restart)
float propertyName;

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.FloatPropertyEdit;

public class AppConfiguration extends Configuration {

    @FloatPropertyEdit(description = "Shot accuracy", minValue = -2.1f, maxValue = 4.1f, regularExpression = "", restart = false)
    public float shotAccuracy;
    
    @Override
    public void reset() {
        super.reset();
        this.shotAccuracy = 3.241f;
    }
    ...

Dart prototype

double get propertyName => nativeDouble('propertyName');

Dart example

import 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    double get shotAccuracy => nativeDouble('shotAccuracy');
    ...

JavaScript example

import {
  NativeModules,
} from 'react-native';

const {Appfigurate} = NativeModules;

...

let shotAccuracy = await Appfigurate.nativeValue("shotAccuracy"); // Number

List UI

Allows a float property to be changed in Appfigurate by allowing the user to select from a predefined list of valid choices.

Swift prototype

@FloatPropertyList(description, restart, values)
var propertyName: Float

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

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {

    @FloatPropertyList(description: "Quality rating", restart: true, values: ["Low": 10.0, "Average": 50.0, "Excellent": 95.0])
    var rating: Float
    
    override func reset() {
        rating = 10.0
    }
    ...

Objective-C prototype

FLOAT_PROPERTY_LIST(propertyName, description, restart, ...)

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) float rating;

@end

@implementation Configuration

FLOAT_PROPERTY_LIST(rating, @"Quality rating", NO, @{@"Low": @10.0, @"Average": @50.0, @"Excellent": @95.0});

- (void) reset {
    self.rating = 10.0;
}
...

Kotlin prototype

@FloatPropertyList(description, keys, values, restart)
var propertyName = 0.0f

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.FloatPropertyList

class AppConfiguration : Configuration() {

    @FloatPropertyList(description = "Quality rating", keys = ["Low", "Average", "Excellent"], values = [10.0f, 50.0f, 95.0f], restart = false)
    var rating = 0.0f
    
    override fun reset() {
        super.reset()
        rating = 10.0f
    }
    ...

Java prototype

@FloatPropertyList(description, keys, values, restart)
float propertyName;

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.FloatPropertyList;

public class AppConfiguration extends Configuration {

    @FloatPropertyList(description = "Quality rating", keys = {"Low", "Average", "Excellent"}, values = {10.0f, 50.0f, 95.0f}, restart = false)
    public float rating;
    
    @Override
    public void reset() {
        super.reset();
        this.rating = 10.0f;
    }
    ...

Dart prototype

double get propertyName => nativeDouble('propertyName');

Dart example

import 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    double get rating => nativeDouble('rating');
    ...

JavaScript example

import {
  NativeModules,
} from 'react-native';

const {Appfigurate} = NativeModules;

...

let rating = await Appfigurate.nativeValue("rating"); // Number

Editable List UI

Allows a float property to be changed in Appfigurate by allowing the user to select from a predefined list of valid choices. The user can customize the list adding by additional values using a text field between minimum and maximum values, and an optional regular expression validating input.

Swift prototype

@FloatPropertyListEdit(min, max, regex, description, restart, values)
var propertyName: Float

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

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {

    @FloatPropertyListEdit(min: 0.0, max: 366.0, regex: #"^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])?(?:\.\d+)?$"#, description: "Forward server time (days)", restart: false, values: ["7 days": 7.0, "1 month": 30.0, "1 Year": 365.0])
    var forwardServerTime: Float
    
    override func reset() {
        forwardServerTime = 7.0
    }
    ...

Objective-C prototype

FLOAT_PROPERTY_LIST_EDIT(propertyName, minValue, maxValue, regex, description, restart, ...)

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) float forwardServerTime;

@end

@implementation Configuration

FLOAT_PROPERTY_LIST_EDIT(forwardServerTime, 0.0, 366.0, @"^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])?(?:\\.\\d+)?$", @"Forward server time (days)", NO, @{@"7 days": @7.0, @"1 month": @30.0, @"1 Year": @365.0});

- (void) reset {
    self.forwardServerTime = 7.0;
}
...

Kotlin prototype

@FloatPropertyListEdit(description, regularExpression, minValue, maxValue, keys, values, restart)
var propertyName = 0.0f

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.FloatPropertyListEdit

class AppConfiguration : Configuration() {

    @FloatPropertyListEdit(description = "Forward server time (days)", minValue = 0.0f, maxValue = 366.0f, regularExpression = "^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$", keys = ["7 days", "1 month", "1 Year"], values = [7.0f, 30.0f, 365.0f], restart = false)
    var forwardServerTime = 0.0f
    
    override fun reset() {
        super.reset()
        forwardServerTime = 7.0f
    }
    ...

Java prototype

@FloatPropertyListEdit(description, regularExpression, minValue, maxValue, keys, values, restart)
float propertyName;

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.FloatPropertyListEdit;

public class AppConfiguration extends Configuration {

    @FloatPropertyListEdit(description = "Forward server time (days)", minValue = 0.0f, maxValue = 366.0f, regularExpression = "^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$", keys = {"7 days", "1 month", "1 Year"}, values = {7.0f, 30.0f, 365.0f}, restart = false)
    public float forwardServerTime;
    
    @Override
    public void reset() {
        super.reset();
        this.forwardServerTime = 7.0f;
    }
    ...

Dart prototype

double get propertyName => nativeDouble('propertyName');

Dart example

import 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    double get forwardServerTime => nativeDouble('forwardServerTime');
    ...

JavaScript example

import {
  NativeModules,
} from 'react-native';

const {Appfigurate} = NativeModules;

...

let forwardServerTime = await Appfigurate.nativeValue("forwardServerTime"); // Number

The React Native module AppfigurateModule class defers to the underlying platform (iOS) or (Android) subclass to read property values.

React Native always converts the underlying Float to a JavaScript Number - you should be aware of .

You can customize the minimum and maximum images using the parameter. If restart is true, then the app will be restarted if the property value changes.

You can customize the minimum and maximum images using the parameter. If restart is true, then the app will be restarted if the property value changes.

APLConfiguration
nz.co.electricbolt.appfiguratelibrary.Configuration
JavaScript's 53 bit limitation
sliderIcon
sliderIcon
reset
reset
APLConfiguration
reset
reset
APLNativeConfiguration
APLConfiguration
nz.co.electricbolt.appfiguratelibrary.Configuration
icon
icon