Yes you can subclass UITabBarItem
to fullfil the style on it's Badge as you want but you can also use the setBadgeTextAttributes:forState:
method of UITabBarItem.
this would look something like..
UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"Atabbar" image:nil tag:0];
item.badgeValue = @"1";
item.badgeColor = UIColor.redColor;
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
style.lineSpacing = 0.00001;
style.lineBreakMode = NSLineBreakByWordWrapping;
style.alignment = NSTextAlignmentLeft;
style.paragraphSpacing = 0.00001;
style.minimumLineHeight = 22.5f;
style.maximumLineHeight = 22.5f;
style.lineHeightMultiple = 1.0;
style.headIndent = 0.0;
style.tailIndent = 0.0;
NSDictionary<NSAttributedStringKey,id> *attr = @{
NSParagraphStyleAttributeName:style,
NSFontAttributeName:[UIFont fontWithName:@"HelveticaNeue-Thin" size:28.0],
NSForegroundColorAttributeName:UIColor.grayColor
};
[item setBadgeTextAttributes:attr forState:UIControlStateNormal];
[item setBadgeTextAttributes:attr forState:UIControlStateHighlighted];
[item setBadgeTextAttributes:attr forState:UIControlStateDisabled];
[item setBadgeTextAttributes:attr forState:UIControlStateSelected];
item.titlePositionAdjustment = UIOffsetMake(0.0, 0.0);
self.tabs.tabBar.items[0] = item;
beware not all NSAttributedString values make sense, cause i don't know what design you wish to achieve.
The endless possiblities are explained in this apple doc
Note you could make your own OTF-Font, copy into your projects Resources and edit info.plist to make this font available in your app and then use it when setting the NSFontAttributeName. But how to make and handle your own font is a completely different question. It may be still more convenient to go on with UIImage
out of your App's Asset to make what you want.