Skip to content

iOS API Reference (DocC)

The full Swift API reference is generated by DocC from the source code documentation.

Generate Locally

sh
cd ios
swift package generate-documentation --output-path docs
open docs/index.html

Browse in Xcode

  1. Open ios/Package.swift in Xcode
  2. Product → Build Documentation (⌃⇧⌘D)
  3. Navigate to "Pretext" in the documentation sidebar

Quick Reference

FunctionDescription
Pretext.prepare(_:font:options:)One-time text analysis + measurement
Pretext.layout(_:maxWidth:lineHeight:)Pure-arithmetic height computation
Pretext.prepareWithSegments(_:font:options:)Rich variant with segment data
Pretext.layoutWithLines(_:maxWidth:lineHeight:)All lines with text + width
Pretext.walkLineRanges(_:maxWidth:onLine:)Line widths without text strings
Pretext.layoutNextLine(_:start:maxWidth:)Variable-width line iterator
Pretext.clearCache()Reset measurement caches
Pretext.setLocale(_:)Change word segmenter locale

Copyright 2026 MaTriXy. All rights reserved. Released under the MIT License.