DOFavoriteButton
DOFavoriteButton copied to clipboard
Take long time to be displayed at UITableViewCell
Thanks for greate library. I use DOFavoriteButton to UITableViewCell. And I use autolayout. I change the button image per cell, because each cell have each state.
Then, it takes long time to display the button. Do you have any idea?
this is snnipet of set data to cell.
func setPostData(post: Post) {
self.post = post
if post.myLikeCount < 5 {
likeIconImageView.imageColorOff = UIColor.myPinkColor()
likeIconImageView.image = UIImage(named: "fav")
}
else {
likeIconImageView.imageColorOff = UIColor.mySecondaryColor()
likeIconImageView.image = UIImage(named: "fav_disabled")
}
}
same problem to me it was even crash I had to edit
public init(frame: CGRect, image: UIImage!) {
super.init(frame: frame)
DispatchQueue.main.async {
self.image = image
self.createLayers(image)
self.addTargets()
self.mDeselect(false)
}
}
public required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)!
DispatchQueue.main.async {
self.createLayers(UIImage())
self.addTargets()
self.mDeselect(false)
}
}
but I'm still having problems. you only see the animation. the image is not drawn