diff --git a/Yattee/Views/Components/SwipeActionModifier.swift b/Yattee/Views/Components/SwipeActionModifier.swift index 74e84abf..6c49924b 100644 --- a/Yattee/Views/Components/SwipeActionModifier.swift +++ b/Yattee/Views/Components/SwipeActionModifier.swift @@ -7,14 +7,22 @@ import SwiftUI -#if os(tvOS) +#if !os(iOS) extension View { - /// On tvOS, swipe actions are not supported - returns the view unmodified. + /// Swipe actions are iOS-only; on macOS/tvOS this returns the view unmodified. @ViewBuilder func swipeActions( - config: SwipeActionConfig = .init(), - @SwipeActionBuilder actions: () -> [SwipeAction] + config _: SwipeActionConfig = .init(), + @SwipeActionBuilder actions _: () -> [SwipeAction] + ) -> some View { + self + } + + @ViewBuilder + func swipeActions( + config _: SwipeActionConfig = .init(), + actionsArray _: [SwipeAction] ) -> some View { self } diff --git a/Yattee/Views/Player/QueueItemRow.swift b/Yattee/Views/Player/QueueItemRow.swift index 8fa846ec..9fc2f8c9 100644 --- a/Yattee/Views/Player/QueueItemRow.swift +++ b/Yattee/Views/Player/QueueItemRow.swift @@ -67,7 +67,7 @@ struct QueueItemRow: View { .contentShape(Rectangle()) } .buttonStyle(.plain) - #if !os(tvOS) + #if os(iOS) .swipeActions(edge: .trailing, allowsFullSwipe: true) { Button(role: .destructive) { onRemove() diff --git a/Yattee/Views/Settings/LayoutNavigationSettingsView.swift b/Yattee/Views/Settings/LayoutNavigationSettingsView.swift index 00dd5d89..d2e3c18f 100644 --- a/Yattee/Views/Settings/LayoutNavigationSettingsView.swift +++ b/Yattee/Views/Settings/LayoutNavigationSettingsView.swift @@ -196,11 +196,13 @@ private struct VideoActionsSection: View { } } + #if os(iOS) NavigationLink { SwipeActionsSettingsView() } label: { Label(String(localized: "settings.appearance.swipeActions"), systemImage: "hand.draw") } + #endif } header: { Text(String(localized: "settings.videoActions.header")) } diff --git a/Yattee/Views/Settings/PlayerControls/PresetSelectorView.swift b/Yattee/Views/Settings/PlayerControls/PresetSelectorView.swift index b032262d..250a2563 100644 --- a/Yattee/Views/Settings/PlayerControls/PresetSelectorView.swift +++ b/Yattee/Views/Settings/PlayerControls/PresetSelectorView.swift @@ -380,7 +380,7 @@ private struct PresetRow: View { .contentShape(Rectangle()) } .buttonStyle(.plain) - #if !os(tvOS) + #if os(iOS) .swipeActions(edge: .trailing, allowsFullSwipe: false) { if let onDelete, !preset.isBuiltIn, canDelete { Button(role: .destructive) {