Mac Developer Library

Developer

AppKit Framework Reference NSTextLayoutOrientationProvider Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSTextLayoutOrientationProvider

The NSTextLayoutOrientationProvider protocol defines the orientation of text for an object. In OS X, the NSTextContainer and NSTextView classes adopt this protocol; in iOS, only the NSTextContainer class implements it. A NSTextContainer object returns the value from its associated text view when present; otherwise, it returns NSTextLayoutOrientationHorizontal by default. If you define a custom NSTextContainer object, you can override this method and return NSTextLayoutOrientationVertical to support laying out text vertically.

  • The default layout orientation. (read-only)

    Declaration

    Swift

    var layoutOrientation: NSTextLayoutOrientation { get }

    Objective-C

    @property(readonly) NSTextLayoutOrientation layoutOrientation

    Discussion

    This property contains the default layout orientation for text in the object that adopts the protocol. If the text contains an explicit NSVerticalGlyphFormAttributeName attribute, that attribute overrides the value in this property. When rendering, TextKit assumes the coordinate system is appropriately rotated.

    Availability

    Available in OS X v10.7 and later.