Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Background-thread layout pre-calculation for iOS, powered by [Yoga](https://gith

Describe layouts with a declarative DSL, calculate frames on a background thread, cache results, and apply them in `layoutSubviews` — eliminating layout computation from the main thread.

Sister library: [LoomText](https://github.com/itsyelo/LoomText) — a CoreText renderer that draws from the same precomputed layout Loom measures with. Typeset once; measurement and rendering share one source of truth.

## Features

- **Background calculation** — Yoga runs on any thread, zero main-thread layout cost
Expand Down
12 changes: 8 additions & 4 deletions Sources/Loom/Loom.docc/Articles/MultilineUILabelTips.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ bodyLabel.frame = frames.frame(for: .body) ?? .zero
## Custom Renderers

If you bind your `Text` node to anything other than `UILabel` —
**`YYLabel`** (Core Text + async drawing), a SwiftUI `Text`, a custom
`CTFrameDraw` view, etc. — the locked-line-height convention above is
not needed. Those renderers don't have UILabel's two-mode internal
**[`LoomLabel`](https://github.com/itsyelo/LoomText)** (Loom's sister
renderer), **`YYLabel`** (Core Text + async drawing), a SwiftUI
`Text`, a custom `CTFrameDraw` view, etc. — the locked-line-height
convention above is not needed. Those renderers don't have UILabel's two-mode internal
alignment, so toggling `numberOfLines` produces zero first-line
jitter without any `paragraphStyle` lock.

Expand Down Expand Up @@ -229,7 +230,10 @@ the same residual is present in YYText's own `UILabelSizeExample` demo
when measured with `YYTextLayout` (the gold-standard CoreText
measurer). Eliminating it entirely requires drawing text yourself
without going through `UILabel`'s rendering pipeline; that decision
trade-off is out of scope for a layout framework.
trade-off is out of scope for a layout framework. It is exactly the
trade-off [LoomText](https://github.com/itsyelo/LoomText) makes: its
`LoomLabel` renders the same `LoomTextLayout` it measures with, so the
toggle residual drops to zero.

## See Also

Expand Down
Loading