Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Commit

Permalink
Do not erase types in views when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
david-swift committed Mar 4, 2024
1 parent 9032161 commit 81a63c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Sources/Adwaita/View/Modifiers/Popover+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<Bool>, @ViewBuilder content: @escaping () -> Body) -> View {
public func popover(visible: Binding<Bool>, @ViewBuilder content: @escaping () -> Body) -> Overlay {
overlay {
Popover(visible: visible)
.child(content)
Expand Down
8 changes: 4 additions & 4 deletions Sources/Adwaita/View/Modifiers/ToastOverlay+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
}

Expand All @@ -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)
}
Expand Down
12 changes: 6 additions & 6 deletions Sources/Adwaita/View/Modifiers/View+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
}
Expand Down

0 comments on commit 81a63c4

Please sign in to comment.