Use this package in a SwiftUI app that needs one of a few small pieces of view behaviour: a sheet that rests at a measured height (presentationDetents(resting:otherwise:pinned:)), content that stays clear of a display fold (Division, set with observingDivision(simulated:) or division(_:) and avoided with displaced(toward:)), a glass Surface, an app-icon style Emblem to share as a PNG, read-only Markdown text, or a paged PDF made from SwiftUI views (pdf(page:margin:spacing:block:) on any Sequence). To build a PDF from HTML or Markdown authored in a Swift DSL instead of from SwiftUI views, use swift-pdf; for declarative PDF views without SwiftUI, use swift-pdf-render.
pdf(page:margin:spacing:block:)measures each element's block at the page width minus both margins, then packs blocks onto pages in sequence order: a block joins the current page if it fits under the page height minus both margins, countingspacing, and otherwise starts a new page. A block is never split across pages. A block taller than the page gets a page of its own and is cut off at the page edge. An empty sequence produces one blank page.Division.simulated(in:width:)places a band of the given width through the centre of the frame, running along the longer side: a vertical band when the frame is at least as wide as it is tall (a square counts as wide), a horizontal band otherwise. A width of zero gives a line.observingDivision(simulated:)provides a simulatedDivisionfor the frame it is applied to, recomputed whenever that frame changes, in global coordinates. Without simulation it provides no division; it never reads a real hardware fold. The environment'sdivisionis nil unless one of these modifiers sets it.displaced(toward:)adds padding only while the view's global frame intersects the division. A horizontal division pushes the content down below the band, whatever the edge. A vertical division pushes the content past the band toward the given edge:.trailingadds leading padding,.leadingadds trailing padding.presentationDetents(resting:otherwise:pinned:)offers the resting height, rounded up to a whole point, and.large; with a nil height theotherwisedetent takes the resting height's place. Views behind the sheet stay interactive up to the resting detent. Withpinned, the sheet offers only the resting detent while it rests there, so the user cannot drag it to.large.Markdownreads the full Markdown syntax and, if that fails to parse, shows the source as plain text. Level 1 headers render as a bold title, all deeper header levels as one bold smaller title; every list item, ordered or not, is shown with its ordinal throughNumbered; every other block is plain text with its inline styling. All text is selectable.Emblemexports the white symbol on a rounded square of its tint, rendered at three times its point size.