List of supported attribute keys for NSString.sizeWithAttributes?

IOS 7 uses NSString::sizeWithAttributes to calculate the size of the NSString bounding box based on NSDictionary attributes. However, I cannot find a resource that lists all the keys listed that are available for use in this NSDictionary .

The NCCtring UIKit add-ons link says that

These are the same attributes that can be applied to an NSAttributedString.

but does not list them, and they are not listed in the NSAttributedString documentation.

Also: of the available attribute keys, which are most important for determining the size of a multi-line label? It seems that the font size and line break mode are the most important, but without a list of available options that are hard to say ...

+6
source share
2 answers

I search for 20 minutes and then find the answer right after posting to SO. Sigh.

For future reference, the available attributes are listed at the bottom of the NSAttributedString - link to the source in the Attributes Section .

+16
source

The above link is dead. Here is a new one .

 let NSAttachmentAttributeName: String let NSBackgroundColorAttributeName: String let NSBaselineOffsetAttributeName: String let NSCursorAttributeName: String let NSExpansionAttributeName: String let NSFontAttributeName: String let NSForegroundColorAttributeName: String let NSKernAttributeName: String let NSLigatureAttributeName: String let NSLinkAttributeName: String let NSMarkedClauseSegmentAttributeName: String let NSObliquenessAttributeName: String let NSParagraphStyleAttributeName: String let NSShadowAttributeName: String let NSSpellingStateAttributeName: String let NSStrikethroughColorAttributeName: String let NSStrikethroughStyleAttributeName: String let NSStrokeColorAttributeName: String let NSStrokeWidthAttributeName: String let NSSuperscriptAttributeName: String let NSTextAlternativesAttributeName: String let NSTextEffectAttributeName: String let NSToolTipAttributeName: String let NSUnderlineColorAttributeName: String let NSUnderlineStyleAttributeName: String let NSVerticalGlyphFormAttributeName: String let NSWritingDirectionAttributeName: String 
+5
source

All Articles