mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-16 04:20:30 +00:00
Use async on dispatch queue to prevent stuttering
This commit is contained in:
parent
207afd9a32
commit
ad91ea5b1b
1 changed files with 9 additions and 5 deletions
|
|
@ -19,15 +19,19 @@ class AppStoreIconFetcher {
|
|||
return
|
||||
}
|
||||
|
||||
iconFetchDispatchQueue.sync {
|
||||
iconFetchDispatchQueue.async {
|
||||
do {
|
||||
let ans = try JITEnableContext.shared.getAppIcon(withBundleId: bundleID)
|
||||
iconCache[bundleID] = ans
|
||||
completion(ans)
|
||||
DispatchQueue.main.async {
|
||||
iconCache[bundleID] = ans
|
||||
completion(ans)
|
||||
}
|
||||
} catch {
|
||||
print("Failed to get icon: \(error)")
|
||||
completion(nil)
|
||||
DispatchQueue.main.async {
|
||||
completion(nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue