You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Creates a FlagGroup with the given parameters.
59
+
///
60
+
/// All FlagGroup's must have at least a `description` which is used for future developer
61
+
/// reference and within Vexillographer, our generated flag management UI.
62
+
///
63
+
/// Attach this to a property within a `@FlagContainer`. The property's type must also
64
+
/// be a `FlagContainer`.
65
+
///
66
+
/// ```swift
67
+
/// @FlagContainer
68
+
/// struct MyFlags {
69
+
/// @FlagGroup(name: "Navigation Flags", description: "These flags are displayed inside a `NavigationLink` (this is the default)", display: .navigation)
70
+
/// var navigation: NavigationFlags
71
+
///
72
+
/// @FlagGroup(name: "Section Flags", description: "These flags are displayed as a `Section`", display: .section)
73
+
/// var section: SectionedFlags
74
+
/// }
75
+
///
76
+
/// @FlagContainer
77
+
/// struct NavigationFlags {
78
+
/// @Flag("First Flag")
79
+
/// var first = false
80
+
/// }
81
+
///
82
+
/// @FlagContainer
83
+
/// struct SectionedFlags {
84
+
/// @Flag("Second Flag")
85
+
/// var second = false
86
+
/// }
87
+
/// ```
88
+
///
89
+
/// - Parameters:
90
+
/// - name: An optional display name to give the flag group. Only visible in flag editors like Vexillographer.
91
+
/// Default is to calculate one based on the property name.
92
+
/// - keyStrategy: An optional strategy to use when calculating the key name. The default is to use the `FlagPole`s strategy.
93
+
/// - description: A description of this flag group. Used in flag editors like Vexillographer, and also for future developer context.
94
+
/// - display: How the flag should be displayed in Vexillographer. Defaults to `.navigation` which wraps it in a
95
+
/// `NavigationLink`. Other options include `.section` to wrap it in a `Section` and `.hidden`
Sometimes though you want to override how a specific flag calculates its key. Vexil allows you to pass in a ``Flag/CodingKeyStrategy`` when you declare your ``Flag`` to alter how its key is calculated:
But sometimes your ``FlagValueSource`` doesn't play nice, or the people naming flags in the backend don't provide the same structure that you want your local flags to be in. You can instead set a manual key path. In this case the ``FlagPole`` will ignore the location of the ``Flag`` in the flag structure and will just use the key you specify.
0 commit comments