diff --git a/Package.swift b/Package.swift index 3930d76..5be9996 100644 --- a/Package.swift +++ b/Package.swift @@ -1,10 +1,10 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.7 import PackageDescription let package = Package( name: "SimpleToast", platforms: [ - .iOS(.v13), .macOS(.v10_15) + .iOS(.v13), .macOS(.v10_15), .tvOS(.v16) ], products: [ .library( diff --git a/README.md b/README.md index 34d6e15..b82f005 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![](https://tinyurl.com/3e9pprjv)](https://swiftpackageindex.com/sanzaru/SimpleToast) [![](https://tinyurl.com/mtkte8as)](https://swiftpackageindex.com/sanzaru/SimpleToast) -SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or MacOS applications in SwiftUI. Because of the flexibility to show any content it is also possible to use the library for showing simple modals. +SimpleToast is a simple, lightweight, flexible and easy to use library to show toasts / popup notifications inside iOS or macOS applications in SwiftUI. Because of the flexibility to show any content it is also possible to use the library for showing simple modals. You decide the content, the library takes care about the rest. diff --git a/Sources/SimpleToast/SimpleToast.swift b/Sources/SimpleToast/SimpleToast.swift index 395d3db..987d45b 100644 --- a/Sources/SimpleToast/SimpleToast.swift +++ b/Sources/SimpleToast/SimpleToast.swift @@ -25,6 +25,7 @@ struct SimpleToast: ViewModifier { private let maxDelta: CGFloat = 20 + #if !os(tvOS) /// Dimiss the toast on drag private var dragGesture: some Gesture { DragGesture() @@ -71,6 +72,7 @@ struct SimpleToast: ViewModifier { offset = .zero } } + #endif @ViewBuilder private var toastRenderContent: some View { @@ -80,13 +82,16 @@ struct SimpleToast: ViewModifier { case .slide: toastInnerContent .modifier(SimpleToastSlide(showToast: $showToast, options: options)) + #if !os(tvOS) .gesture(dragGesture) + #endif case .scale: toastInnerContent .modifier(SimpleToastScale(showToast: $showToast, options: options)) + #if !os(tvOS) .gesture(dragGesture) - + #endif case .skew: toastInnerContent .modifier(SimpleToastSkew(showToast: $showToast, options: options)) @@ -100,7 +105,9 @@ struct SimpleToast: ViewModifier { default: toastInnerContent .modifier(SimpleToastFade(showToast: $showToast, options: options)) + #if !os(tvOS) .gesture(dragGesture) + #endif } } .onTapGesture(perform: dismissOnTap)