         return UIEdgeInsets(top: countInsetTop, left: countInsetLeft, bottom: countInsetBottom, right: countInsetRight)
     }
     
+    override func layoutSubviews() {
+        super.layoutSubviews()
+        setNeedsDisplay()
+    }
+    
     override func draw(_ rect: CGRect) {
         if let titleLabel = titleLabel {
             let countFont = UIFont(name: titleLabel.font.fontName,

            
            let badgePath = UIBezierPath(rect: badgeRect)
            badgePath.lineWidth = lineWidth
            titleLabel.textColor.set()
            badgePath.stroke()
        }
    }

            var countStringAttributes: [String: Any] = [:]
            countStringAttributes[NSFontAttributeName] = countFont
            if let textColor = titleLabel.textColor {
                countStringAttributes[NSForegroundColorAttributeName] = textColor.withAlphaComponent(titleLabel.alpha)
            } else {
                countStringAttributes[NSForegroundColorAttributeName] = UIColor.clear
            }
