mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 13:12:53 +00:00
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.
24 lines
622 B
Swift
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
|
|
}
|
|
}
|