macbackend/Sources/MacBackend/AnyView.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

34 lines
967 B
Swift

//
// AnyView.swift
// MacBackend
//
// Created by david-swift on 04.12.2024.
//
@_exported import Core
extension AnyView {
// swiftlint:disable function_default_parameter_at_end
/// Add an alert to a view.
/// - Parameters:
/// - title: The title.
/// - description: The description.
/// - isPresented: Whether the alert is visible.
/// - Returns: The alert.
public func alert(_ title: String, description: String = "", isPresented: Meta.Binding<Bool>) -> Alert {
.init(title: title, description: description, isPresented: isPresented, child: self)
}
// swiftlint:enable function_default_parameter_at_end
/// Set the padding.
/// - Parameters:
/// - padding: The padding.
/// - edges: The edges.
/// - Returns: The view.
public func padding(_ padding: Double, edges: Set<Edge> = .all) -> Meta.AnyView {
PaddingView(padding: padding, edges: edges, child: self)
}
}