NumberFormatter textAttributesForNegativeValues, etc. have wrong type
Originator: | mayoff | ||
Number: | rdar://44980887 | Date Originated: | 03-Oct-2018 01:40 PM |
Status: | Open | Resolved: | |
Product: | iOS + SDK | Product Version: | 12.0 |
Classification: | UI/Usability | Reproducible: | Always |
Summary: Dear Foundationeros, `NumberFormatter` (the Swift interface for `NSNumberFormatter`) declares several properties: open var textAttributesForNegativeValues: [String : Any]? open var textAttributesForPositiveValues: [String : Any]? open var textAttributesForZero: [String : Any]? open var textAttributesForNil: [String : Any]? open var textAttributesForNotANumber: [String : Any]? open var textAttributesForPositiveInfinity: [String : Any]? open var textAttributesForNegativeInfinity: [String : Any]? Since these are intended to hold `NSAttributedString` keys and values, having a key type of `String` leads to inconvenience in setting these properties, and extra conversions when using them to construct `NSAttributedStrings`. Please change the type of these properties to `[NSAttributedString.Key: Any]?`. Thanks, Rob Steps to Reproduce: Expected Results: Actual Results: Version: 12.0 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!