Double

double is a double-precision 8 byte floating-point type with an approximate range of 2.3E-308 to 1.7E+308.

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

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

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

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

Slider UI

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

Prototype

DOUBLE_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) double maxDecibel;

@end

@implementation Configuration

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

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

Editable UI

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

Prototype

DOUBLE_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) double shotAccuracy;

@end

@implementation Configuration

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

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

List UI

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

Prototype

DOUBLE_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) double rating;

@end

@implementation Configuration

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

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

Editable List UI

Allows a double 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

DOUBLE_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) double forwardServerTime;

@end

@implementation Configuration

DOUBLE_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;
}
...

Last updated