         badgeLabel.textColor = badgeProperties.textColor
         badgeLabel.backgroundColor = badgeProperties.backgroundColor
     }
+}
+
+// MARK: - Public Functions
+public extension BadgedBarButtonItem {
+    
+    /**
+     Programmatically adds a target-action pair to the BadgedBarButtonItem
+    */
+    public func addTarget(_ target: AnyObject, action: Selector) {
+        self.target = target
+        self.action = action
+    }
     
     /**
      Creates the internal UIButton to be used as the custom view of the UIBarButtonItem.

        
        return btn
    }
}

// MARK: - Public Functions
public extension BadgedBarButtonItem {
    
    /**
     Programmatically adds a target-action pair to the BadgedBarButtonItem
    */
    public func addTarget(_ target: AnyObject, action: Selector) {
        self.target = target
        self.action = action
    }
}


    
    func updateBadgeProperties() {
        if let customView = self.customView {
            calculateUpdatedBadgeFrame(usingFrame: customView.frame)
        }
    }
    
