Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UITableViewCell #23

Open
justdan0227 opened this issue Sep 6, 2021 · 2 comments
Open

UITableViewCell #23

justdan0227 opened this issue Sep 6, 2021 · 2 comments

Comments

@justdan0227
Copy link

how to you set the badge to be upper left corner in the text of a UITableViewCell.textLabel ? I tried setCircleAtFrame and it shows up left but cut off and when I scroll then it shows up left and a second one on the right? With dequeue do I have to do something to use it in a UITableViewCell?

@justdan0227
Copy link
Author

So the only way I found to do this is to have an invisible UIView on the cell as well and attach the BadgeHub to it. You also have to hide the view every time the cell is retrieved and then set it visible if there is a badge to show

@justdan0227
Copy link
Author

Found a better way! Just remove all of the sub views of your imageview

in your UITableViewCell add this:

override func prepareForReuse() {
super.prepareForReuse()
VIEWOFYOURIMAGE.subviews.forEach { $0.removeFromSuperview() }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant