We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
selectedItem
1 parent 1e158c4 commit c1e9c3eCopy full SHA for c1e9c3e
DropDown/src/DropDown.swift
@@ -955,7 +955,7 @@ extension DropDown {
955
and `cellConfiguration` implicitly calls `reloadAllComponents()`.
956
*/
957
public func reloadAllComponents() {
958
- DispatchQueue.main.async {
+ DispatchQueue.executeOnMainThread {
959
self.tableView.reloadData()
960
self.setNeedsUpdateConstraints()
961
}
@@ -1184,3 +1184,13 @@ extension DropDown {
1184
1185
1186
1187
+
1188
+private extension DispatchQueue {
1189
+ static func executeOnMainThread(_ closure: @escaping Closure) {
1190
+ if Thread.isMainThread {
1191
+ closure()
1192
+ } else {
1193
+ main.async(execute: closure)
1194
+ }
1195
1196
+}
0 commit comments