macbackend/Sources/Core/View/ScrollView.swift
david-swift 3d2ef52cc8
Some checks failed
Deploy Docs / publish (push) Successful in 3m4s
SwiftLint / SwiftLint (push) Failing after 9s
Extract core target
2024-12-04 21:17:21 +01:00

37 lines
804 B
Swift

//
// ScrollView.swift
// MacBackend
//
// Created by david-swift on 02.12.2024.
//
import SwiftUI
/// The scroll view widget.
public struct ScrollView: SwiftUIWidget {
/// The view's content.
var content: Body
/// The wrapped views.
public var wrappedViews: [String: any Meta.AnyView] {
[.mainContent: content]
}
/// Initialize the scroll view.
/// - Parameter content: The content view.
public init(@Meta.ViewBuilder content: () -> Body) {
self.content = content()
}
/// Get the SwiftUI view.
/// - Parameter properties: The widget data.
/// - Returns: The SwiftUI view.
public static func view(properties: Self) -> some SwiftUI.View {
SwiftUI.ScrollView {
MacBackendView(.mainContent)
}
}
}