diff --git a/Sources/Adwaita/View/Modifiers/Popover+.swift b/Sources/Adwaita/View/Modifiers/Popover+.swift index 9a42214..de4d314 100644 --- a/Sources/Adwaita/View/Modifiers/Popover+.swift +++ b/Sources/Adwaita/View/Modifiers/Popover+.swift @@ -43,7 +43,7 @@ extension View { /// - visible: Whether the popover is displayed. /// - content: The popover's content. /// - Returns: The view. - public func popover(visible: Binding, @ViewBuilder content: @escaping () -> Body) -> View { + public func popover(visible: Binding, @ViewBuilder content: @escaping () -> Body) -> Overlay { overlay { Popover(visible: visible) .child(content) diff --git a/Sources/Adwaita/View/Modifiers/ToastOverlay+.swift b/Sources/Adwaita/View/Modifiers/ToastOverlay+.swift index c0aad08..0b5e8c5 100644 --- a/Sources/Adwaita/View/Modifiers/ToastOverlay+.swift +++ b/Sources/Adwaita/View/Modifiers/ToastOverlay+.swift @@ -57,8 +57,8 @@ extension View { /// - title: The title of the toast. /// - signal: The signal which activates the presentation of a toast. /// - Returns: A view. - public func toast(_ title: String, signal: Signal) -> View { - ToastOverlay(title, signal: signal) + public func toast(_ title: String, signal: Signal) -> ToastOverlay { + .init(title, signal: signal) .child { self } } @@ -69,8 +69,8 @@ extension View { /// - button: The button's label. /// - handler: The handler for the button. /// - Returns: A view. - public func toast(_ title: String, signal: Signal, button: String, handler: @escaping () -> Void) -> View { - ToastOverlay(title, signal: signal) + public func toast(_ title: String, signal: Signal, button: String, handler: @escaping () -> Void) -> ToastOverlay { + .init(title, signal: signal) .child { self } .action(button: button, handler: handler) } diff --git a/Sources/Adwaita/View/Modifiers/View+.swift b/Sources/Adwaita/View/Modifiers/View+.swift index b43ada2..e9f6127 100644 --- a/Sources/Adwaita/View/Modifiers/View+.swift +++ b/Sources/Adwaita/View/Modifiers/View+.swift @@ -26,8 +26,8 @@ extension View { /// - toolbar: The toolbar's content. /// - visible: Whether the toolbar is visible. /// - Returns: A view. - public func topToolbar(visible: Bool = true, @ViewBuilder _ toolbar: @escaping () -> Body) -> View { - ToolbarView() + public func topToolbar(visible: Bool = true, @ViewBuilder _ toolbar: @escaping () -> Body) -> ToolbarView { + .init() .content { self } .top(toolbar) .revealTopBars(visible) @@ -38,8 +38,8 @@ extension View { /// - toolbar: The toolbar's content. /// - visible: Whether the toolbar is visible. /// - Returns: A view. - public func bottomToolbar(visible: Bool = true, @ViewBuilder _ toolbar: @escaping () -> Body) -> View { - ToolbarView() + public func bottomToolbar(visible: Bool = true, @ViewBuilder _ toolbar: @escaping () -> Body) -> ToolbarView { + .init() .content { self } .bottom(toolbar) .revealBottomBars(visible) @@ -49,8 +49,8 @@ extension View { /// - Parameters: /// - overlay: The overlay view. /// - Returns: A view. - public func overlay(@ViewBuilder _ overlay: @escaping () -> Body) -> View { - Overlay() + public func overlay(@ViewBuilder _ overlay: @escaping () -> Body) -> Overlay { + .init() .child { self } .overlay(overlay) }