Declaration

func registerEntries(_ entries: [[String : Any]], forCategory category: String)

Declaration

- (void) registerEntries:(NSArray<NSDictionary<NSString *,id> *> *) entries forCategory:(NSString *) category;

Declaration

registerEntries_forCategory_(entries: list[NSDictionary<NSString *,id>], category: str)

Discussion

Each entry is a dictionary with required key and type elements. The key is the user defaults key. The type is one of string, bool, int (any king of integer), float (any kind of floating point number, including double), or color.

A title key can provide a user-friendly display title for the entry. A details key can provide a user-friendly display description of the entry that is shown in a tool tip. A options key can provide additional infos about the entry.

Schema:

{
    title: NSString
    key: NSString (required)
    type: NSString (required)
    details: NSString
    options: NSDictionary {
        minValue: NSNumber (for type `int` and `float`)
        maxValue: NSNumber (for type `int` and `float`)
        enum: NSArray<NSString *> (for type `string`)
        enum: NSArray<NSNumber *> (for type `int`)
        enumTitles: NSDictionary<NSString *, NSString *> (for type `string`)
        enumTitles: NSDictionary<NSNumber *, NSString *> (for type `int`)
    }
}
  • The minValue and maxValue options limit the range of possible values.

  • The enum option provides an ordered set of possible raw values.

  • The enumTitles option maps enum raw values to display titles. Raw values without a mapped title are displayed directly.