Integer
Last updated
Last updated
Int
is platform dependent, 32-bit signed values on 32-bit CPUs (Apple Watch; arm64_32) and 64-bit signed values on 64-bit CPUs (iPhone, iPad; arm64).
The default value of a Int
is 0. You can change the default value of the property by assigning a new value in an overridden reset
method.
NSInteger
is platform dependent, 32-bit signed values on 32-bit CPUs (Apple Watch arm64_32) and 64-bit signed values on 64-bit CPUs (iPhone, iPad arm64).
The default value of a NSInteger
is 0. You can change the default value of the property by assigning a new value in an overridden reset
method.
NSInteger
properties should be declared in your APLConfiguration
subclass header file as follows:
@import AppfigurateLibrary;
@interface Configuration : APLConfiguration
@property(nonatomic, assign) NSInteger propertyName;
...
The default value of an Int
is 0. You can change the default value of the property by assigning a new value in an overridden reset
method.
The default value of an int
is 0. You can change the default value of the property by assigning a new value in an overridden reset
method.
The flutter APLNativeConfiguration
class defers to the underlying platform APLConfiguration
(iOS) or nz.co.electricbolt.appfiguratelibrary.Configuration
(Android) subclass to read property values.
The React Native module AppfigurateModule
class defers to the underlying platform APLConfiguration
(iOS) or nz.co.electricbolt.appfiguratelibrary.Configuration
(Android) subclass to read property values.
React Native always converts the underlying Integer to a JavaScript Number - you should be aware of JavaScript's 53 bit limitation.
Allows an integer property to be changed in Appfigurate using a slider between minimum and maximum values.
Swift prototype
@IntPropertySlider(min, max, icon, description, restart)
var propertyName: Int
You can customize the minimum and maximum images using the icon
parameter. If restart
is true
, then the app will be restarted if the property value changes.
Swift example
import AppfigurateLibrary
@objcMembers class Configuration: APLConfiguration {
@IntPropertySlider(min: 50, max: 100, icon: .volume, description: "Limit volume level", restart: true)
var volumeRange: Int
override func reset() {
volumeRange = 75
}
...
Objective-C prototype
INT_PROPERTY_SLIDER(propertyName, minValue, maxValue, icon, description, restart)
You can customize the minimum and maximum images using the icon
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) NSInteger volumeRange;
@end
@implementation Configuration
INT_PROPERTY_SLIDER(volumeRange, 50, 100, APLIconSliderVolume, @"Limit volume level", NO);
- (void) reset {
self.volumeRange = 75;
}
...
Kotlin prototype
@IntPropertySlider(description, minValue, maxValue, sliderIcon, restart)
var propertyName = 0
You can customize the minimum and maximum images using the sliderIcon
parameter. If restart
is true
, then the app will be restarted if the property value changes.
Kotlink example
import nz.co.electricbolt.appfiguratelibrary.Configuration
import nz.co.electricbolt.appfiguratelibrary.annotations.IntPropertySlider
import nz.co.electricbolt.appfiguratelibrary.annotations.IconSlider
class AppConfiguration : Configuration() {
@IntPropertySlider(description = "Limit volume level", minValue = 50, maxValue = 100, sliderIcon = IconSlider.IconSliderVolume, restart = false)
var volumeRange = 0
override fun reset() {
super.reset()
volumeRange = 75
}
...
Java prototype
@IntPropertySlider(description, minValue, maxValue, sliderIcon, restart)
int propertyName;
You can customize the minimum and maximum images using the sliderIcon
parameter. 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.IntPropertySlider;
import nz.co.electricbolt.appfiguratelibrary.annotations.IconSlider;
public class AppConfiguration extends Configuration {
@IntPropertySlider(description = "Limit volume level", minValue = 50, maxValue = 100, sliderIcon = IconSlider.IconSliderVolume, restart = false)
public int volumeRange;
@Override
public void reset() {
super.reset();
this.volumeRange = 75;
}
...
Dart prototype
int get propertyName => nativeInt('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
int get volumeRange => nativeInt('volumeRange');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let volumeRange = await Appfigurate.nativeValue("volumeRange"); // Number
Allows an integer property to be changed in Appfigurate using a text field between minimum and maximum values, and an optional regular expression validating input.
Swift prototype
@IntPropertyEdit(min, max, regex, description, restart)
var propertyName: Int
If restart
is true
, then the app will be restarted if the property value changes.
Swift example
import AppfigurateLibrary
@objcMembers class Configuration: APLConfiguration {
@IntPropertyEdit(min: 1, max: 5, regex: "", description: "Maximum number of game levels", restart: false)
var gameLevels: Int
override func reset() {
gameLevels = 3
}
...
Objective-C prototype
INT_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) NSInteger gameLevels;
@end
@implementation Configuration
INT_PROPERTY_EDIT(gameLevels, 1, 5, @"", @"Maximum number of game levels", NO);
- (void) reset {
self.gameLevels = 3;
}
...
Kotlin prototype
@IntPropertyEdit(description, minValue, maxValue, regularExpression, restart)
var propertyName = 0
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.IntPropertyEdit
class AppConfiguration : Configuration() {
@IntPropertyEdit(description = "Maximum number of game levels", minValue = 1, maxValue = 5, restart = false)
var gameLevels = 0
override fun reset() {
super.reset()
gameLevels = 3
}
...
Java prototype
@IntPropertyEdit(description, minValue, maxValue, regularExpression, restart)
int 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.IntPropertyEdit;
public class AppConfiguration extends Configuration {
@IntPropertyEdit(description = "Maximum number of game levels", minValue = 1, maxValue = 5, restart = false)
public int gameLevels;
@Override
public void reset() {
super.reset();
this.gameLevels = 3;
}
...
Dart prototype
int get propertyName => nativeInt('propertyName');
Dart example
Dimport 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
int get gameLevels => nativeInt('gameLevels');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let gameLevels = await Appfigurate.nativeValue("gameLevels"); // Number
Allows an integer property to be changed in Appfigurate by allowing the user to select from a predefined list of valid choices.
Swift prototype
@IntPropertyList(description, restart, values)
var propertyName: Int
If restart
is true
, then the app will be restarted if the property value changes.
Swift example
import AppfigurateLibrary
@objcMembers class Configuration: APLConfiguration {
@IntPropertyList(description: "Quality rating", restart: false, values: ["Low": 10, "Average": 50, "Excellent": 95])
var rating: Int
override func reset() {
rating = 10
}
...
Objective-C prototype
INT_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) NSInteger rating;
@end
@implementation Configuration
INT_PROPERTY_LIST(rating, @"Quality rating", NO, @{@"Low": @10, @"Average": @50, @"Excellent": @95});
- (void) reset {
self.rating = 10;
}
...
Kotlin prototype
@IntPropertyList(description, keys, values, restart)
var propertyName = 0
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.IntPropertyList
class AppConfiguration : Configuration() {
@IntPropertyList(description = "Quality rating", keys = ["Low", "Average", "Excellent"], values = [10, 50, 95], restart = false)
var rating = 0
override fun reset() {
super.reset()
rating = 10
}
...
Java prototype
@IntPropertyList(description, keys, values, restart)
int propertyName;
If restart
is true
, then the app will be restarted if the property value changes.
Java example
import nz.co.electricbolt.appfiguratelibrary.Configuration;java
import nz.co.electricbolt.appfiguratelibrary.annotations.IntPropertyList;
public class AppConfiguration extends Configuration {
@IntPropertyList(description = "Quality rating", keys = {"Low", "Average", "Excellent"}, values = {10, 50, 95}, restart = false)
public int rating;
@Override
public void reset() {
super.reset();
this.rating = 10;
}
...
Dart prototype
int get propertyName => nativeInt('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
int get rating => nativeInt('rating');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let rating = await Appfigurate.nativeValue("rating"); // Number
Allows an integer 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
@IntPropertyListEdit(min, max, regex, description, restart, values)
var propertyName: Int
If restart
is true
, then the app will be restarted if the property value changes.
Swift example
import AppfigurateLibrary
@objcMembers class Configuration: APLConfiguration {
@IntPropertyListEdit(min: 0, max: 365, regex: "^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$", description: "Duration in days emails are available", restart: false, values: ["7 days": 7, "1 month": 30, "1 Year": 365])
var availablityDuration: Int
override func reset() {
volumeRange = 7
}
...Swift
Objective-C prototype
INT_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) NSInteger availabilityDuration;
@end
@implementation Configuration
INT_PROPERTY_LIST_EDIT(availablityDuration, 0, 365, @"^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$", @"Duration in days emails are available", NO, @{@"7 days": @7, @"1 month": @30, @"1 Year": @365});
- (void) reset {
self.volumeRange = 7;
}
...Objective-C
Kotlin prototype
@IntPropertyListEdit(description, regularExpression, minValue, maxValue, keys, values, restart)
Int propertyName;
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.IntPropertyListEdit
class AppConfiguration : Configuration() {
@IntPropertyListEdit(description = "Duration in days emails are available", minValue = 0, maxValue = 365, 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, 30, 365], restart = false)
var availablityDuration = 0
override fun reset() {
super.reset()
availabilityDuration = 7
}
...
Java prototype
@IntPropertyListEdit(description, regularExpression, minValue, maxValue, keys, values, restart)
int 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.IntPropertyListEdit;
public class AppConfiguration extends Configuration {
@IntPropertyListEdit(description = "Duration in days emails are available", minValue = 0, maxValue = 365, 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, 30, 365}, restart = false)
public int availablityDuration;
@Override
public void reset() {
super.reset();
this.availabilityDuration = 7;
}
...
Dart prototype
int get propertyName => nativeInt('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
int get availabilityDuration => nativeInt('availabilityDuration');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let availabilityDuration = await Appfigurate.nativeValue("availabilityDuration"); // Number