Skip to content

Commit 471ed0c

Browse files
authored
fix(ios): remove thread warning on Haptics.selectionEnd() (#2860)
1 parent 34dd280 commit 471ed0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ios/Capacitor/Capacitor/Plugins/Haptics.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ public class CAPHapticsPlugin: CAPPlugin {
5858
}
5959

6060
@objc public func selectionEnd(_ call: CAPPluginCall) {
61-
selectionFeedbackGenerator = nil
61+
DispatchQueue.main.async {
62+
self.selectionFeedbackGenerator = nil
63+
}
6264
}
6365

6466
@objc public func vibrate(_ call: CAPPluginCall) {

0 commit comments

Comments
 (0)