Integer

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

Slider UI

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

Editable UI

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

List UI

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

Editable List UI

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

Last updated