When you update your badge value, add such a method:
func updateBadge(#value: UInt, tabBarItemTag: Int) {
self.viewControllerForTag(tabBarItemTag)?.tabBarItem.badgeValue = value
for badgeView in (tabBar.subviews[tabBarItemTag] as! UIView).subviews {
let className = "\(_stdlib_getDemangledTypeName(badgeView))"
if className.rangeOfString("BadgeView").location != NSNotFound {
badgeView.layer.transform = CATransform3DIdentity
badgeView.layer.transform = CATransform3DMakeTranslation(0.0, 10.0, 20.0)
}
}
}
You need to play a bit with a second CATransform3DMakeTranslation to make right positioning. In this code badge moves a bit on bottom/left. First CATransform3DMakeTranslation is needed to pretend badge moving. It is a Swift code, but you can convert it to Objective-C easily.