The badge position can be changed by assigning an `UITabBarItemAppearance` object to the item appearance properties of an `UITabBarAppearance` object, and assign this to the **appearance** property of your **tabBar** control. Example:
let itemAppearance = UITabBarItemAppearance()
itemAppearance.normal.badgePositionAdjustment.horizontal = 10
let appearance = UITabBarAppearance()
appearance.stackedLayoutAppearance = itemAppearance
appearance.inlineLayoutAppearance = itemAppearance
appearance.compactInlineLayoutAppearance = itemAppearance
tabBar.standardAppearance = appearance
Positive values seems to shift the badge to the left when using iOS 16, in contradiction to what the documentation says.
When using iOS 13 or newer, the badge position can be changed by assigning an `UITabBarItemAppearance` object to the item appearance properties of an `UITabBarAppearance` object, and assign this to the **appearance** property of your **tabBar** control. Example:
let itemAppearance = UITabBarItemAppearance()
itemAppearance.normal.badgePositionAdjustment.horizontal = 10
let appearance = UITabBarAppearance()
appearance.stackedLayoutAppearance = itemAppearance
appearance.inlineLayoutAppearance = itemAppearance
appearance.compactInlineLayoutAppearance = itemAppearance
tabBar.standardAppearance = appearance
According the documentation, the badge should be shifted to the right because 10 is a positive value, but it actually shifted the badge to the left, which I needed. Not sure if this is bug.