Files
yattee/Yattee/Extensions/View+PlatformSheet.swift
Arkadiusz Fal 3e561cc3b5 Present error details and Open Link through the shared sheet host
Error details were declared in the video info view and the expanded
player, and Open Link three times: at the app root for deep links and
for the File menu command, and on Home. All of them are now AppSheets;
the deep link and menu requests go through the global request, so a
deep link that arrives while the player is expanded no longer opens the
sheet behind it.

The four sign-in modals that were a full-screen cover on tvOS and a
sheet elsewhere, each written out twice, use a platformSheet helper.
2026-10-04 21:04:19 +02:00

24 lines
622 B
Swift

//
// View+PlatformSheet.swift
// Yattee
//
// A modal that is a full-screen cover on tvOS and a sheet elsewhere, for
// forms (sign-in) that need the whole screen on tvOS.
//
import SwiftUI
extension View {
func platformSheet<Item: Identifiable, Content: View>(
item: Binding<Item?>,
onDismiss: (() -> Void)? = nil,
@ViewBuilder content: @escaping (Item) -> Content
) -> some View {
#if os(tvOS)
fullScreenCover(item: item, onDismiss: onDismiss, content: content)
#else
sheet(item: item, onDismiss: onDismiss, content: content)
#endif
}
}