david-swift 04c77831b5
Some checks are pending
Deploy Docs / publish (push) Waiting to run
SwiftLint / SwiftLint (push) Waiting to run
Remove Core library
2025-10-30 21:36:13 +01:00

32 lines
692 B
Swift

//
// Form.swift
// Adwaita
//
// Created by david-swift on 03.01.24.
//
import CAdw
/// A list with no dynamic content styled as a boxed list.
public struct Form: SimpleView {
/// The content.
var content: Body
/// The view's body.
public var view: Body {
ModifierWrapper(
content: List([Int](content.indices), selection: nil) { index in content[index] },
style: "boxed-list",
styleActive: true
)
}
/// Initialize a `Form`.
/// - Parameter content: The view content, usually different kind of rows.
public init(@ViewBuilder content: @escaping () -> Body) {
self.content = content()
}
}