       completion()
     }
   }
+  /// Mask the bdage view if needed.
+  private func _maskBadgeViewIfNeeded(
+    with masking: Mask)
+  {
+    layer.mask = masking._layer(for: bounds)
+  }
+  /// Stroke the badge view's edges if needed.
+  ///
+  /// - Parameter strokeColor: The color of the strokes. Nil to ignore stroke.
+  private func _strokeEdgesOfBadgeViewIfNeeded(
+    with strokeColor: CGColor?)
+  {
+    if
+      let strokeColor = strokeColor
+    {
+      _strokeLayer.frame = bounds
+      _strokeLayer.path = masking.path(bounds.insetBy(dx: 0.5, dy: 0.5))
+      _strokeLayer.strokeColor = strokeColor
+      _strokeLayer.fillColor = nil
+      _strokeLayer.strokeStart = 0.0
+      _strokeLayer.strokeEnd = 1.0
+      _strokeLayer.lineWidth = 1.0
+      layer.addSublayer(_strokeLayer)
+    } else {
+      _strokeLayer.removeFromSuperlayer()
+    }
+  }
 }

  /// Returns the badge view of the receiver.
  public var badge: BadgeView {
    get {
      if let badge = objc_getAssociatedObject(self, &_AssociatedKeys.badge) as? BadgeView {
        return badge
      }

    }
    
    set {
      if self is BadgeView {
        fatalError("The badge view of 'BadgeView' itself is not accessible.")
      }
      
      objc_setAssociatedObject(
        self,
        &_AssociatedKeys.badge,
