Fix UIKit methods being invoked off main thread

This commit is contained in:
Shadowfacts 2019-01-14 16:58:23 -05:00
parent 882f03a94b
commit 5b3a3d9729
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 6 additions and 2 deletions

View File

@ -31,12 +31,16 @@ class ConversationMainStatusTableViewCell: UITableViewCell, PreferencesAdaptive
var favorited: Bool = false {
didSet {
favoriteButton.tintColor = favorited ? UIColor(displayP3Red: 1, green: 0.8, blue: 0, alpha: 1) : tintColor
DispatchQueue.main.async {
self.favoriteButton.tintColor = self.favorited ? UIColor(displayP3Red: 1, green: 0.8, blue: 0, alpha: 1) : self.tintColor
}
}
}
var reblogged: Bool = false {
didSet {
reblogButton.tintColor = reblogged ? UIColor(displayP3Red: 1, green: 0.8, blue: 0, alpha: 1) : tintColor
DispatchQueue.main.async {
self.reblogButton.tintColor = self.reblogged ? UIColor(displayP3Red: 1, green: 0.8, blue: 0, alpha: 1) : self.tintColor
}
}
}