Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions FlipcashUI/Sources/FlipcashUI/Views/Containers/Background.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,27 @@
import SwiftUI

public struct Background<Content>: View where Content: View {
public var background: AnyView
public var content: Content
private let color: Color
private let content: Content

// MARK: - Init -

public init(color: Color, @ViewBuilder content: () -> Content) {
self.background = AnyView(color)
self.color = color
self.content = content()
}

// MARK: - Body -

// ZStack (not `.background`) — on iOS 26 the modifier form exposes
// content's TupleView at the top of the wrapper, causing parent
// `.toolbar { ToolbarItem }` items to duplicate per top-level sibling.
public var body: some View {
content
.background {
background
.ignoresSafeArea()
}
ZStack {
color
.ignoresSafeArea()
.allowsHitTesting(false)
content
}
}
}