iOS Developer Library

Developer

UIKit Framework Reference NSMutableParagraphStyle Class Reference

Options
Deployment Target:

On This Page
Language:

NSMutableParagraphStyle

Inherits From


Conforms To


Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 6.0 and later

The NSMutableParagraphStyle class adds methods to its superclass, NSParagraphStyle, for changing the values of the subattributes in a paragraph style attribute. See the NSParagraphStyle and NSAttributedString specifications for more information.

  • alignment alignment Property

    The text alignment of the receiver.

    Declaration

    Swift

    var alignment: NSTextAlignment

    Objective-C

    @property(readwrite) NSTextAlignment alignment

    Discussion

    Natural text alignment is realized as left or right alignment depending on the line sweep direction of the first script contained in the paragraph. For a list of alignment constants, see the “Constants” section of NSString UIKit Additions Reference.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The indentation of the first line of the receiver.

    Declaration

    Swift

    var firstLineHeadIndent: CGFloat

    Objective-C

    @property(readwrite) CGFloat firstLineHeadIndent

    Discussion

    This property contains the distance (in points) from the leading margin of a text container to the beginning of the paragraph’s first line. This value is always nonnegative.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The indentation of the receiver’s lines other than the first.

    Declaration

    Swift

    var headIndent: CGFloat

    Objective-C

    @property(readwrite) CGFloat headIndent

    Discussion

    This property contains the distance (in points) from the leading margin of a text container to the beginning of lines other than the first. This value is always nonnegative.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The trailing indentation of the receiver.

    Declaration

    Swift

    var tailIndent: CGFloat

    Objective-C

    @property(readwrite) CGFloat tailIndent

    Discussion

    If positive, this value is the distance from the leading margin (for example, the left margin in left-to-right text). If 0 or negative, it’s the distance from the trailing margin.

    For example, a paragraph style designed to fit exactly in a 2-inch wide container has a head indent of 0.0 and a tail indent of 0.0. One designed to fit with a quarter-inch margin has a head indent of 0.25 and a tail indent of –0.25.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The mode that should be used to break lines in the receiver.

    Declaration

    Swift

    var lineBreakMode: NSLineBreakMode

    Objective-C

    @property(readwrite) NSLineBreakMode lineBreakMode

    Discussion

    This property contains the line break mode to be used laying out the paragraph’s text. For a list of line break constants, see the “Constants” section of NSParagraphStyle Class Reference.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The receiver’s maximum line height.

    Declaration

    Swift

    var maximumLineHeight: CGFloat

    Objective-C

    @property(readwrite) CGFloat maximumLineHeight

    Discussion

    This property contains the maximum height in points that any line in the receiver will occupy, regardless of the font size or size of any attached graphic. This value is always nonnegative. The default value is 0.

    Glyphs and graphics exceeding this height will overlap neighboring lines; however, a maximum height of 0 implies no line height limit. Although this limit applies to the line itself, line spacing adds extra space between adjacent lines.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The receiver’s minimum height.

    Declaration

    Swift

    var minimumLineHeight: CGFloat

    Objective-C

    @property(readwrite) CGFloat minimumLineHeight

    Discussion

    This property contains the minimum height in points that any line in the receiver will occupy, regardless of the font size or size of any attached graphic. This value must be nonnegative.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The distance in points between the bottom of one line fragment and the top of the next.

    Declaration

    Swift

    var lineSpacing: CGFloat

    Objective-C

    @property(readwrite) CGFloat lineSpacing

    Discussion

    This value is always nonnegative. This value is included in the line fragment heights in the layout manager.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The space after the end of the paragraph.

    Declaration

    Swift

    var paragraphSpacing: CGFloat

    Objective-C

    @property(readwrite) CGFloat paragraphSpacing

    Discussion

    This property contains the space (measured in points) added at the end of the paragraph to separate it from the following paragraph. This value must be nonnegative. The space between paragraphs is determined by adding the previous paragraph’s paragraphSpacing and the current paragraph’s paragraphSpacingBefore.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The distance between the paragraph’s top and the beginning of its text content.

    Declaration

    Swift

    var paragraphSpacingBefore: CGFloat

    Objective-C

    @property(readwrite) CGFloat paragraphSpacingBefore

    Discussion

    This property contains the space (measured in points) between the paragraph’s top and the beginning of its text content. The default value of this property is 0.0.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

    See Also

    paragraphSpacing

  • The base writing direction for the receiver.

    Declaration

    Swift

    var baseWritingDirection: NSWritingDirection

    Objective-C

    @property(readwrite) NSWritingDirection baseWritingDirection

    Discussion

    If you specify NSWritingDirectionNaturalDirection, the receiver resolves the writing direction to either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft, depending on the direction for the user’s language preference setting.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • The line height multiple.

    Declaration

    Swift

    var lineHeightMultiple: CGFloat

    Objective-C

    @property(readwrite) CGFloat lineHeightMultiple

    Discussion

    The natural line height of the receiver is multiplied by this factor (if positive) before being constrained by minimum and maximum line height. The default value of this property is 0.0.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later

  • Replaces the tab stops in the receiver with tabStops.

    Declaration

    Swift

    var tabStops: [AnyObject]?

    Objective-C

    @property(readwrite, copy, nonatomic) NSArray *tabStops

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later

  • Sets the default tab interval for the receiver.

    Declaration

    Swift

    var defaultTabInterval: CGFloat

    Objective-C

    @property(readwrite, nonatomic) CGFloat defaultTabInterval

    Discussion

    Tabs after the last specified in tabStops are placed at integral multiples of this distance. This value must be nonnegative.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later

  • tabStops tabStops Property

    An array of NSTextTab objects representing the receiver’s tab stops.

    Declaration

    Swift

    var tabStops: [AnyObject]?

    Objective-C

    @property(readwrite, copy, nonatomic) NSArray *tabStops

    Discussion

    The NSTextTab objects, sorted by location, define the tab stops for the paragraph style. Default value is nil.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later

  • The document-wide default tab interval.

    Declaration

    Swift

    var defaultTabInterval: CGFloat

    Objective-C

    @property(readwrite, nonatomic) CGFloat defaultTabInterval

    Discussion

    This property represents the default tab interval in points. Tabs after the last specified in tabStops are placed at integer multiples of this distance (if positive). Default value is 0.0.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 7.0 and later

    See Also

    tabStops

  • The paragraph’s threshold for hyphenation.

    Declaration

    Swift

    var hyphenationFactor: Float

    Objective-C

    @property(readwrite) float hyphenationFactor

    Discussion

    Valid values lie between 0.0 and 1.0 inclusive. The default value is 0.0. Hyphenation is attempted when the ratio of the text width (as broken without hyphenation) to the width of the line fragment is less than the hyphenation factor. When the paragraph’s hyphenation factor is 0.0, the layout manager’s hyphenation factor is used instead. When both are 0.0, hyphenation is disabled.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 6.0 and later