DisclosureGroup
struct · iOS 14.0+ · SDK 27.1
nonisolated struct DisclosureGroup<Label, Content> where Label : View, Content : ViewA view that shows or hides another content view, based on the state of a disclosure control. A disclosure group view consists of a label to identify the contents, and a control to show and hide the contents. Showing the contents puts the disclosure group into the "expanded" state, and hiding them makes the disclosure group "collapsed". In the following example, a disclosure group contains two toggles and an embedded disclosure group. The top level disclosure group exposes its expanded state with the bound property, `topLevelExpanded`. By expanding the disclosure group, the user can use the toggles to update the state of the `toggleStates` structure. struct ToggleStates { var oneIsOn: Bool = false var twoIsOn: Bool = true } @State private var toggleStates = ToggleStates() @State private var topExpanded: Bool = true var body: some View { DisclosureGroup("Items", isExpanded: $topExpanded) { Toggle("Toggle 1", isOn: $toggleStates.oneIsOn) Toggle("Toggle 2", isOn: $toggleStates.twoIsOn) DisclosureGroup("Sub-items") { Text("Sub-item 1") } } }
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
9 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
DisclosureGroup.init(content:label:)
callback cannot propagate synchronous failure
DisclosureGroup.init(isExpanded:content:label:)
callback cannot propagate synchronous failure
DisclosureGroup.body
This protocol needs associated types that cannot yet cross the bridge.
DisclosureGroup.init(_:content:)
callback cannot propagate synchronous failure
DisclosureGroup.init(_:content:)
callback cannot propagate synchronous failure
DisclosureGroup.init(_:isExpanded:content:)
callback cannot propagate synchronous failure
DisclosureGroup.init(_:isExpanded:content:)
callback cannot propagate synchronous failure
DisclosureGroup.init(_:content:)
callback cannot propagate synchronous failure
DisclosureGroup.init(_:isExpanded:content:)
callback cannot propagate synchronous failure