Skip to content

Instantly share code, notes, and snippets.

@danielmartin
Created February 10, 2018 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielmartin/90ee691efc21879a3d15822aa77c3436 to your computer and use it in GitHub Desktop.
Save danielmartin/90ee691efc21879a3d15822aa77c3436 to your computer and use it in GitHub Desktop.
Header description of variantFittingPresentationWidth: method
/*
For strings with length variations, such as from a stringsdict file, this method returns the variant at the given width.
If there is no variant at the given width, the one for the next smaller width is returned. And if there are none smaller,
the smallest available is returned. For strings without variations, this method returns self.
The unit that width is expressed in is decided by the application or framework. But it is intended to be some measurement
indicative of the context a string would fit best to avoid truncation and wasted space.
*/
- (NSString *)variantFittingPresentationWidth:(NSInteger)width API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment