Latest 0.1.0
Homepage https://github.com/yasinturkdogan/YTBarButtonItemWithBadge
License MIT
Platforms ios 8.0
Authors

Simple UIBarButtonItem with badge support

alt text

 Installation

pod 'YTBarButtonItemWithBadge', '~> 0.1'

or copy YTBarButtonItemWithBadge.swift to your project

Usage

func viewDidLoad() {
  let buttonWithBadge = YTBarButtonItemWithBadge();
  buttonWithBadge.setHandler(callback: onClick);
  buttonWithBadge.setImage(image: UIImage(named: "icon.png")!);
  buttonWithBadge.setTitle(value: "My Button");
  buttonWithBadge.setBadge(value: "10");
  self.navigationItem.setRightBarButton(buttonWithBadge.getBarButtonItem(), animated: true);
}

func onClick() {
  //Do stuff
}

Latest podspec

{
    "name": "YTBarButtonItemWithBadge",
    "version": "0.1.0",
    "summary": "UIBarButtonItem with badge support",
    "description": "YTBarButtonItemWithBadge enables to add badge on corner of the UIBarButtonItem.",
    "homepage": "https://github.com/yasinturkdogan/YTBarButtonItemWithBadge",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Yasin Turkdogan": "[email protected]"
    },
    "source": {
        "git": "https://github.com/yasinturkdogan/YTBarButtonItemWithBadge.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "YTBarButtonItemWithBadge/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This