Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix: hidden badge is 0 badge

  • Loading branch information...
commit b14312e8c132ad97ba5e8694e1bb6356df8d6630 1 parent 1b46ced
@yonat authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 BadgeView/BadgeTableViewCell.m
View
6 BadgeView/BadgeTableViewCell.m
@@ -15,7 +15,7 @@ @implementation BadgeTableViewCell
- (void)layoutBadge
{
- if (badge == nil || [badge.text length] == 0) return;
+ if (badge == nil || badge.hidden || [badge.text length] == 0) return;
CGRect badgeFrame = badge.frame;
CGRect contentBounds = self.contentView.bounds;
badgeFrame.origin.y = contentBounds.origin.y + (contentBounds.size.height - badgeFrame.size.height) / 2;
@@ -32,8 +32,8 @@ - (void)createBadge
- (NSInteger)badgeNumber
{
- if (self.badge) {
- return [self.badge.text integerValue];
+ if (badge && !badge.hidden) {
+ return [badge.text integerValue];
}
return 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.