enm

ENMBadgedBarButtonItem

A navigation bar button item that can be badged

Showing:

Popularity

Downloads/wk

0

GitHub Stars

89

Maintenance

Last Commit

2yrs ago

Contributors

8

Package

Dependencies

0

License

MIT

Categories

Readme

ENMBadgedBarButtonItem - Swift

Swift CocoaPods Carthage compatible

A UIBarButtonItem that can be badged!

Screenshot


Usage

A BadgedBarButtonItem can be created programmatically or from a storyboard.

For programmatic use, a badged bar item can be instantiated with

let image = UIImage(imageLiteralResourceName: "barbuttonimage")
let buttonFrame: CGRect = CGRect(x: 0.0, y: 0.0, width: image.size.width, height: image.size.height)
let barButton = BadgedBarButtonItem(
    startingBadgeValue: 0,
    frame: buttonFrame,
    image: image
)

leftBarButton = barButton
leftBarButton?.addTarget(self, action: #selector(leftBarButtonTapped(_:)))
navigationItem.leftBarButtonItem = leftBarButton

From a storyboard, instantiation is as easy as creating an IBOutlet and connecting it in Interface Builder:

@IBOutlet fileprivate var rightBarButton: BadgedBarButtonItem!

Use the BadgeProperties class to customize the badge bar item's appearance and position.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100