I am using the modifier sheet(item:onDismiss:content:) to show a sheet, where the content of the sheet depends on the item that is passed as parameter. The body of the sheet is built using a function which is passed the item as parameter.
Here is a simplified example:
struct ContentView: View {
@State private var sheetContent: SheetContent?
var body: some View {
HStack(spacing: 30) {
Button("Foo") { sheetContent = .foo }
Button("Bar") { sheetContent = .bar }
}
.buttonStyle(.bordered)
.sheet(item: $sheetContent, content: sheetBody) // 👈 issue here
}
private func sheetBody(contentType: SheetContent) -> some View {
Text("\(contentType)".capitalized)
.font(.largeTitle)
.foregroundStyle(.white)
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(contentType == .foo ? .yellow : .orange)
.onTapGesture { sheetContent = nil }
}
}
enum SheetContent: Identifiable {
case foo
case bar
var id: SheetContent { self }
}
Up until Xcode 26.0 beta 3, this compiled without warnings, even when using Swift 6 with strict concurrency checking. With the beta 3 version and Swift 6, it now shows the following warning against the .sheet modifier:

⚠️ Cannot convert '@MainActor @Sendable (SheetContent) -> some View' to '@MainActor (SheetContent) -> some View' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol; this will be an error in a future Swift language mode
❕Type 'some View' does not conform to 'Sendable' protocol
One workaround is to use a closure to call the function sheetBody, instead of trying to pass the function as a parameter:
.sheet(item: $sheetContent) { item in
sheetBody(contentType: item)
}
However, I am wondering if this workaround can be avoided by adding annotations to the function in some way? I tried adding @Sendable, but this also requires making it async, which no longer satisfies the signature of the sheet modifier.
How can the function be passed as parameter to the .sheet modifier without Xcode 26.0 beta 3 reporting a warning?
UPDATE The warnings are no longer shown with Xcode beta 5. So no workaround necessary.