Skip to content

Commit 17cef50

Browse files
committed
Fix non Darwin platform build issue
1 parent 8d98525 commit 17cef50

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Sources/OpenSwiftUI/View/Control/SensoryFeedback/SensoryFeedbackGenerator.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,3 +226,23 @@ private struct FeedbackGenerator<T>: SensoryFeedbackGeneratorModifier where T: E
226226
}
227227
}
228228
}
229+
230+
#if !canImport(Darwin)
231+
// MARK: - View + platformSensoryFeedback
232+
233+
extension View {
234+
nonisolated func platformSensoryFeedback<Base>(
235+
_ base: Base
236+
) -> some View where Base: SensoryFeedbackGeneratorModifier {
237+
modifier(base)
238+
}
239+
}
240+
241+
// MARK: - FeedbackRequestContext
242+
243+
struct FeedbackRequestContext {
244+
func implementation(type: SensoryFeedback.FeedbackType) -> (any PlatformSensoryFeedback)? {
245+
nil
246+
}
247+
}
248+
#endif

0 commit comments

Comments
 (0)