DOFavoriteButton icon indicating copy to clipboard operation
DOFavoriteButton copied to clipboard

Take long time to be displayed at UITableViewCell

Open yukitoto opened this issue 9 years ago • 1 comments

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")
        }
}


yukitoto avatar Jul 25 '16 23:07 yukitoto

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

rogomantik avatar Sep 18 '16 14:09 rogomantik