Plain String

The default value of a NSString is nil. You must change the default value of the property by assigning a new value in an overridden reset method.

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

@property(nonatomic, strong) NSString* propertyName;
...

This page describes plain textual strings. Appfigurate also supports encrypted strings.

Editable UI

Allows a string property to be changed in Appfigurate using a text field with an optional regular expression validating input.

Prototype

STRING_PROPERTY_EDIT(propertyName, regex, description, restart)

Example

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

@property(nonatomic, strong) NSString* usernameOverride;

@end

@implementation Configuration

STRING_PROPERTY_EDIT(usernameOverride, @"", @"Overridden session username", NO);

- (void) reset {
    self.usernameOverride = @"thomas52";
}
...

List UI

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

Prototype

STRING_PROPERTY_LIST(propertyName, description, restart, ...)

Example

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

@property(nonatomic, strong) NSString* backgroundColorHex;

@end

@implementation Configuration

STRING_PROPERTY_LIST(backgroundColorHex, @"Color of background", NO, @{@"LightGray": @"#d3d3d3", @"White": @"#ffffff", @"Beige": @"f5fcdc"});

- (void) reset {
    self.backgroundColorHex = "#d3d3d3";
}
...

Editable List UI

Allows a string 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 and an optional regular expression validating input.

Prototype

STRING_PROPERTY_LIST_EDIT(propertyName, regex, description, restart, ...)

Example

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

@property(nonatomic, strong) NSString* foregroundColorHex;

@end

@implementation Configuration

STRING_PROPERTY_LIST_EDIT(foregroundColorHex, @"^#([a-f0-9]{6})$", @"Color of foreground", NO, @{@"Black": @"#000000", @"MistyRose": @"#ffe4e1", @"LightBlue": @"add8e6"});

- (void) reset {
    self.foregroundColorHex = @"#ffe4e1";
}
...

Last updated