Skip to content

Commit

Permalink
@mainactor to ensure execution on the main thread for iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
dm-zharov committed Apr 3, 2024
1 parent 6aebb86 commit dfbc069
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/HapticFeedback/HapticFeedback.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ extension HapticFeedback {
/// - On a device with a supported Taptic Engine.
/// - When the app is running in the foreground.
/// - When the System Haptics setting is enabled.
#if os(iOS) || targetEnvironment(macCatalyst)
@MainActor
#endif
public func play() {
HapticFeedbackManager.defaultPerformer.perform(type)
}
Expand Down

0 comments on commit dfbc069

Please sign in to comment.