From 471ed0c635c5cfc888547eafe754fb8e936b678f Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Fri, 1 May 2020 19:13:07 +0200 Subject: [PATCH] fix(ios): remove thread warning on Haptics.selectionEnd() (#2860) --- ios/Capacitor/Capacitor/Plugins/Haptics.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/Capacitor/Capacitor/Plugins/Haptics.swift b/ios/Capacitor/Capacitor/Plugins/Haptics.swift index ce8a0032d1..c025ebc8af 100644 --- a/ios/Capacitor/Capacitor/Plugins/Haptics.swift +++ b/ios/Capacitor/Capacitor/Plugins/Haptics.swift @@ -58,7 +58,9 @@ public class CAPHapticsPlugin: CAPPlugin { } @objc public func selectionEnd(_ call: CAPPluginCall) { - selectionFeedbackGenerator = nil + DispatchQueue.main.async { + self.selectionFeedbackGenerator = nil + } } @objc public func vibrate(_ call: CAPPluginCall) {