SimpleToast is blocking tvOS preview
Closed this issue · 2 comments
Kyle-Ye commented
For a multi platform projects, we can conditional link it to exclude tvOS in building and also use #canImport in Swift code.
This works fine for building and archiving. However this will cause an issue when previewing SwiftUI view on tvOS.
== PREVIEW UPDATE ERROR:
SchemeBuildError: Failed to build the scheme ”Forumate”
'DragGesture' is unavailable in tvOS
Compile SimpleToast.swift (arm64):
/Users/kyle/Library/Developer/Xcode/DerivedData/Forumate-cfcvrozqvmyfrfcrzfasktaukvys/SourcePackages/checkouts/SimpleToast/Sources/SimpleToast/SimpleToast.swift:30:9: error: 'DragGesture' is unavailable in tvOS
DragGesture()
^~~~~~~~~~~
Kyle-Ye commented
At first, I was thinking adding a PR to add something like @unavaiable(tvOS)
mark to SimpleToast
. But later I find we can add tvOS support directly.
There are only 2 issues here:
- onTapGesture(count:) is supported on tvOS via tvOS 16.0 which is supported on Package manifest version 5.7.
- DragGesture is not available on tvOS. We can just use
#if os(tvOS)
to remove this feature.
If you are fine about it, I'm glad to add a pull request here. @sanzaru