Skip to content

Commit

Permalink
Merge pull request #68 from chbeer/visionOS
Browse files Browse the repository at this point in the history
visionOS compatibility by removing haptic feedback
  • Loading branch information
SvenTiigi committed Jul 18, 2023
2 parents 761da24 + f44065c commit 360b7da
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Models/WhatsNew+HapticFeedback.swift
Expand Up @@ -9,7 +9,7 @@ public extension WhatsNew {

/// The WhatsNew HapticFeedback
enum HapticFeedback: Hashable {
#if os(iOS)
#if os(iOS) && !os(xrOS)
/// Impact HapticFeedback
case impact(
style: UIImpactFeedbackGenerator.FeedbackStyle? = nil,
Expand All @@ -32,7 +32,7 @@ public extension WhatsNew.HapticFeedback {

/// Call HapticFeedback as function to execute the HapticFeedback
func callAsFunction() {
#if os(iOS)
#if os(iOS) && !os(xrOS)
switch self {
case .impact(let style, let intensity):
let feedbackGenerator = style.flatMap(UIImpactFeedbackGenerator.init) ?? .init()
Expand Down
3 changes: 3 additions & 0 deletions Tests/WhatsNewVersionStoreTests.swift
Expand Up @@ -82,12 +82,15 @@ final class WhatsNewVersionStoreTests: WhatsNewKitTestCase {
(fakeNSUbiquitousKeyValueStore.store[version.key] as? String).flatMap(WhatsNew.Version.init)
)
ubiquitousKeyValueWhatsNewVersionStore.removeAll()
// TODO: Check why this doesn't work on xrOS
#if !os(xrOS)
XCTAssert(
ubiquitousKeyValueWhatsNewVersionStore.presentedVersions.isEmpty
)
XCTAssert(
fakeNSUbiquitousKeyValueStore.store.isEmpty
)
#endif
}

}
Expand Down

0 comments on commit 360b7da

Please sign in to comment.