Latest | 1.3.0 |
---|---|
Homepage | https://github.com/PauliusVindzigelskis/NGSBadgeBarButton |
License | MIT |
Platforms | ios 9.0 |
Frameworks | UIKit |
Authors |
v1.1 Swift 3.2 – 4.2
v1.2 Swift 4.0 – 5.0
v1.3 Swift 5
Install
Cocoapod
pod 'NGSBadgeBarButton'
Manual
Import NGSBadgeBarButton.swift file into Your project
Dependencies
None
Usage
Note: ‘insets’ parameter can be omit to use default value
// Set badge value and control label appearance
public private(set) weak var badgeLabel:UILabel! = nil
// Badge Bar Button with image
init(badgeButtonWithImage image: UIImage,
target: Any,
selector: Selector,
insets: UIEdgeInsets = NGSBadgeBarButton.kDefaultBadgeInsets)
// Badge Bar Button with title
init(badgeButtonWithTitle text: String,
target: Any,
selector: Selector,
insets: UIEdgeInsets = NGSBadgeBarButton.kDefaultBadgeInsets)
// Custom Badge Bar Button
init(badgeButtonWithCustomView customView: UIView,
insets: UIEdgeInsets = NGSBadgeBarButton.kDefaultBadgeInsets)
Demo
Latest podspec
{ "name": "NGSBadgeBarButton", "version": "1.3.0", "swift_version": "5.0", "summary": "UIBarButton with red badge in corner", "description": "UIBarButton subclass to provide option to set red badge on its corner. AutoLayout in action", "homepage": "https://github.com/PauliusVindzigelskis/NGSBadgeBarButton", "screenshots": "https://user-images.githubusercontent.com/2383901/36121468-e32e9756-100b-11e8-9e64-ddcd0d6e8514.gif", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Paulius Vindzigelskis": "[email protected]" }, "source": { "git": "https://github.com/PauliusVindzigelskis/NGSBadgeBarButton.git", "tag": "R1.3/1.3.0" }, "platforms": { "ios": "9.0" }, "source_files": "Pod/*.{swift}", "frameworks": "UIKit" }
Thu, 28 Mar 2019 11:15:09 +0000