Skip to content

Commit

Permalink
macos problem fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ilkerulusoy committed Sep 15, 2024
1 parent c2305ab commit 830751b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sources/Extensions/Extension+HapticFeedback.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,27 @@
//

import SwiftUI
#if os(iOS)
import UIKit
#endif

struct HapticFeedbackModifier: ViewModifier {
let feedbackStyle: SensoryFeedbackWrapper
@Binding var trigger: Int

func body(content: Content) -> some View {
#if os(iOS)
content
.modifier(ConditionalSensoryFeedbackModifier(feedbackStyle: feedbackStyle, trigger: $trigger))
#else
content

#endif
}

}


#if os(iOS)
struct ConditionalSensoryFeedbackModifier: ViewModifier {
let feedbackStyle: SensoryFeedbackWrapper
@Binding var trigger: Int
Expand Down Expand Up @@ -83,6 +90,7 @@ struct ConditionalSensoryFeedbackModifier: ViewModifier {
impact.notificationOccurred(oldFeedbackStyle)
}
}
#endif

public enum SensoryFeedbackWrapper {
case success
Expand Down

0 comments on commit 830751b

Please sign in to comment.