Use correct queues for user interface elements

This commit is contained in:
Maurice Parker 2019-10-31 12:22:37 -05:00
parent 34d0142dbc
commit 1e7b71a482
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ extension RSImage {
static let avatarSize = 48
static func scaledForAvatar(_ data: Data, imageResultBlock: @escaping (RSImage?) -> Void) {
DispatchQueue.global().async {
DispatchQueue.global(qos: .userInteractive).async {
let image = RSImage.scaledForAvatar(data)
DispatchQueue.main.async {
imageResultBlock(image)

View File

@ -16,7 +16,7 @@ final class AvatarView: UIView {
imageView.image = image
if self.traitCollection.userInterfaceStyle == .dark {
DispatchQueue.global(qos: .background).async {
DispatchQueue.global(qos: .userInteractive).async {
if self.image?.isDark() ?? false {
DispatchQueue.main.async {
self.isDisconcernable = false