I\'m displaying badge on tab bar but when number increase it goes out to tab bar item like shown in image
In Objective-C:
for (UIView *tabBarButton in self.navigationController.tabBarController.tabBar.subviews)
{
for (UIView *badgeView in tabBarButton.subviews)
{
NSString *className = NSStringFromClass([badgeView class]);
// Looking for _UIBadgeView
if ([className rangeOfString:@"BadgeView"].location != NSNotFound)
{
badgeView.layer.transform = CATransform3DIdentity;
badgeView.layer.transform = CATransform3DMakeTranslation(-5.0, 1.0, 1.0);
}
}
}