One Logo Pool Ball
UIKit · IOS API REFERENCE

NSTextLayoutFragment

class · iOS 15.0+ · SDK 27.1

class NSTextLayoutFragment

Members (21)

method · iOS 15.0+

draw

TypeScript
draw(point: { x: number; y: number }, context: _CoreGraphics_CGContext): void
Swift declaration
func draw(at point: CGPoint, in context: CGContext)
method · iOS 15.0+

frameForTextAttachment

TypeScript
frameForTextAttachment(location: SDKHandle): { x: number; y: number; width: number; height: number }
Swift declaration
func frameForTextAttachment(at location: any NSTextLocation) -> CGRect
init · iOS 15.0+

init

TypeScript
static initCoder(coder: _Foundation_NSCoder): (NSTextLayoutFragment) | null
Swift declaration
init?(coder: NSCoder)
init · iOS 15.0+

init

TypeScript
static initTextElementRange(textElement: NSTextElement, rangeInElement?: (NSTextRange) | null): NSTextLayoutFragment
Swift declaration
init(textElement: NSTextElement, range rangeInElement: NSTextRange?)
method · iOS 15.0+

invalidateLayout

TypeScript
invalidateLayout(): void
Swift declaration
func invalidateLayout()
method · iOS 17.0+

textLineFragment

TypeScript
textLineFragmentForIsUpstreamAffinity(textLocation: SDKHandle, isUpstreamAffinity: boolean): (NSTextLineFragment) | null
Swift declaration
func textLineFragment(for textLocation: any NSTextLocation, isUpstreamAffinity: Bool) -> NSTextLineFragment?
method · iOS 17.0+

textLineFragment

TypeScript
textLineFragmentForVerticalOffsetRequiresExactMatch(verticalOffset: number, requiresExactMatch: boolean): (NSTextLineFragment) | null
Swift declaration
func textLineFragment(forVerticalOffset verticalOffset: CGFloat, requiresExactMatch: Bool) -> NSTextLineFragment?
get · iOS 15.0+

bottomMargin

TypeScript
get bottomMargin(): number
Swift declaration
var bottomMargin: CGFloat { get }
get · iOS 15.0+

layoutFragmentFrame

TypeScript
get layoutFragmentFrame(): { x: number; y: number; width: number; height: number }
Swift declaration
var layoutFragmentFrame: CGRect { get }
get · iOS 15.0+

layoutQueue

TypeScript
get layoutQueue(): (_Foundation_OperationQueue) | null
Swift declaration
var layoutQueue: OperationQueue? { get set }
set · iOS 15.0+

layoutQueue

TypeScript
set layoutQueue(value: (_Foundation_OperationQueue) | null)
Swift declaration
var layoutQueue: OperationQueue? { get set }
get · iOS 15.0+

leadingPadding

TypeScript
get leadingPadding(): number
Swift declaration
var leadingPadding: CGFloat { get }
get · iOS 15.0+

rangeInElement

TypeScript
get rangeInElement(): NSTextRange
Swift declaration
var rangeInElement: NSTextRange { get }
get · iOS 15.0+

renderingSurfaceBounds

TypeScript
get renderingSurfaceBounds(): { x: number; y: number; width: number; height: number }
Swift declaration
var renderingSurfaceBounds: CGRect { get }
get · iOS 15.0+

state

TypeScript
get state(): NSTextLayoutFragment_State
Swift declaration
var state: NSTextLayoutFragment.State { get }
get · iOS 15.0+

textAttachmentViewProviders

TypeScript
get textAttachmentViewProviders(): Array<NSTextAttachmentViewProvider>
Swift declaration
var textAttachmentViewProviders: [NSTextAttachmentViewProvider] { get }
get · iOS 15.0+

textElement

TypeScript
get textElement(): (NSTextElement) | null
Swift declaration
weak var textElement: NSTextElement? { get }
get · iOS 15.0+

textLayoutManager

TypeScript
get textLayoutManager(): (NSTextLayoutManager) | null
Swift declaration
weak var textLayoutManager: NSTextLayoutManager? { get }
get · iOS 15.0+

textLineFragments

TypeScript
get textLineFragments(): Array<NSTextLineFragment>
Swift declaration
var textLineFragments: [NSTextLineFragment] { get }
get · iOS 15.0+

topMargin

TypeScript
get topMargin(): number
Swift declaration
var topMargin: CGFloat { get }
get · iOS 15.0+

trailingPadding

TypeScript
get trailingPadding(): number
Swift declaration
var trailingPadding: CGFloat { get }

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NSTextLayoutFragment.init()

inherited init: cannot prove legal (class declares 1 custom initializer)

All UIKit types →