NSLengthFormatter: Allow Selection of Allowed Units

Originator:SlaunchaMan
Number:rdar://24029950 Date Originated:31-Dec-2015 11:42 PM
Status:Open Resolved:
Product:iOS SDK Product Version:9.2
Classification:Enhancement Reproducible:Always
 
Summary:
Sometimes you need an NSLengthFormatter that only uses a subset of the included units. It’d be nice to have an option to provide an allowed list of units.

Steps to Reproduce:
1. Use NSLengthFormatter for short (< 1 mile) distances.

Expected Results:
You can make the formatter output “0.1 mi.”

Actual Results:
You get a value in yards.

Notes:
What I want is something like this in NSLengthFormatter:

- (void)setAllowedUnits:(NSLengthFormatterUnit)unitMask;

Where unitMask is an option set of NSLengthFormatterUnits.

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!