Setting a title for UITabBarItem with variantFittingPresentationWidth results in using the wrong string

Originator:fbe
Number:rdar://41193359 Date Originated:17-Juni-2018 09:22 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11
Classification:UI/Usability Reproducible:Always
 
Summary:
When setting a title in a UITabBarItem with a String using `variantFittingPresentationWidth(_:)`, the String is read out from the `Localizable.stringsdict` correctly but it is using the shorter variant with a text alignment to left when displaying the String in the UITabBarItem on simulator.

Steps to Reproduce:
1. Define a String with two values with `NSStringVariableWidthRuleType` in `Localizable.stringsdict` for the keys `1` and `30`
2. Define a string using `NSLocalizedString(key:comment)` casted to NSString
3. Create a new variable with calling `variantFittingPresentationWidth(30)` on the localized String.
4. Set the title in a UITabBarItem with the new variable

Expected Results:
UITabBarItem.title uses the long string defined in Localizable.stringsdict with text alignment to center

Actual Results:
UITabBarItem.title displays the short string defined in Localizable.stringsdict with text alignment to left 

Version:
iOS 11

Notes:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!