From 980463285ce01a4f2a64ad0cb688074fd44504a2 Mon Sep 17 00:00:00 2001 From: Oded Harth Date: Fri, 30 Dec 2016 16:03:56 +0200 Subject: [PATCH 1/2] Update README.md --- README.md | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 975e140..5ae55f2 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,33 @@ [![Version](https://img.shields.io/cocoapods/v/SuperBadges.svg?style=flat)](http://cocoapods.org/pods/SuperBadges) [![License](https://img.shields.io/cocoapods/l/SuperBadges.svg?style=flat)](http://cocoapods.org/pods/SuperBadges) [![Platform](https://img.shields.io/cocoapods/p/SuperBadges.svg?style=flat)](http://cocoapods.org/pods/SuperBadges) +![language](https://img.shields.io/badge/Language-%20Swift%20-orange.svg) -## Example +

+ +

-To run the example project, clone the repo, and run `pod install` from the Example directory first. +Add emojis and colored dots as badges for your Tab Bar buttons ✨ -## Requirements +## Usage + +Add an emoji badge: + +```swift + YourTabBarController.addDotAtTabBarItemIndex(index: 0, radius: 10, text : "👏🏻") +``` + +Add a colored dot badge: + +```swift + YourTabBarController.addDotAtTabBarItemIndex(index: 0, radius: 7, color : UIColor.blue) +``` + +Remove badge: + +```swift + YourTabBarController.removeDotAtTabBarItemIndex(index: 0) +``` ## Installation @@ -21,7 +42,10 @@ pod "SuperBadges" ## Author -odedharth, odedharth@gmail.com +[1]: http://www.twitter.com/odedharth +[1.1]: http://i.imgur.com/wWzX9uB.png (twitter icon with padding) + +Oded Harth [![alt text][1.1]][1] ## License From a2147ad2bafb359f1c4c5a6c7c0037295bc1624e Mon Sep 17 00:00:00 2001 From: Oded Harth Date: Fri, 30 Dec 2016 16:15:32 +0200 Subject: [PATCH 2/2] Update SuperBadges.swift --- SuperBadges/Classes/SuperBadges.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/SuperBadges/Classes/SuperBadges.swift b/SuperBadges/Classes/SuperBadges.swift index 7d093c6..b64ad65 100644 --- a/SuperBadges/Classes/SuperBadges.swift +++ b/SuperBadges/Classes/SuperBadges.swift @@ -1,6 +1,4 @@ -import UIKit - -extension UITabBarController { +public extension UITabBarController { func addDotAtTabBarItemIndex(index: Int, radius : CGFloat = 5, color : UIColor = UIColor.red, text : String? = nil) { let tag = index + 999 for subview in self.tabBar.subviews {