Skip to content

Instantly share code, notes, and snippets.

@davidlawson
davidlawson / BadgeBarButtonItem.swift
Last active December 8, 2021 10:33
UIBarButtonItem with badge, Swift 4, iOS 9/10/11
import UIKit
public class BadgeBarButtonItem: UIBarButtonItem
{
@IBInspectable
public var badgeNumber: Int = 0 {
didSet {
self.updateBadge()
}
}