Integer
Last updated
Last updated
NSInteger
is platform dependent, 32-bit signed values on 32-bit CPUs and 64-bit signed values on 64-bit CPUs.
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;
...
Int
is platform dependent, 32-bit signed values on 32-bit CPUs and 64-bit signed values on 64-bit CPUs.
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.
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.
Allows an integer property to be changed in Appfigurate using a slider between minimum and maximum values.
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.
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;
}
...
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.
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
}
...
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.
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;
}
...
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.
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
}
...
Prototype
int get propertyName => nativeInt('propertyName');
Example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
int get volumeRange => nativeInt('volumeRange');
...
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.
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.
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;
}
...
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.
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
}
...
Prototype
@IntPropertyEdit(description, minValue, maxValue, regularExpression, restart)
int propertyName;
If restart
is true
, then the app will be restarted if the property value changes.
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;
}
...
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.
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
}
...
Prototype
int get propertyName => nativeInt('propertyName');
Example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
int get gameLevels => nativeInt('gameLevels');
...
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.
Prototype
INT_PROPERTY_LIST(propertyName, description, restart, ...)
If restart
is YES
, then the app will be restarted if the property value changes.
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;
}
...
Prototype
@IntPropertyList(description, restart, values)
var propertyName: Int
If restart
is true
, then the app will be restarted if the property value changes.
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
}
...
Prototype
@IntPropertyList(description, keys, values, restart)
int propertyName;
If restart
is true
, then the app will be restarted if the property value changes.
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;
}
...
Prototype
@IntPropertyList(description, keys, values, restart)
var propertyName = 0
If restart
is true
, then the app will be restarted if the property value changes.
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
}
...
int get propertyName => nativeInt('propertyName');
Example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
int get rating => nativeInt('rating');
...
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.
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.
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;
}
...
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.
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
}
...
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.
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;
}
...
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.
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
}
...
Prototype
int get propertyName => nativeInt('propertyName');
Example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
int get availabilityDuration => nativeInt('availabilityDuration');
...
Example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let availabilityDuration = await Appfigurate.nativeValue("availabilityDuration"); // Number