tornikegomareli / swift-pretextkit
PublicSwift port of chenglou/pretext, pure arithmetic text measurement & layout engine for Apple platforms
PretextKit is a Swift library for Apple platforms that precomputes expensive text measurements to enable instant reflow and sizing in dynamic UIs like feeds, games, and editorial layouts.
How It Works
You hear about a tool that makes text in apps wrap and resize super smoothly, even around moving shapes or in fast-scrolling lists.
Run the example app to watch text flow around bouncing balls, Tetris pieces, or game paddles in real time without lag.
Bring this magic into your own project with a simple copy-paste link, and it starts working right away.
Tell it once about your words and how they should look, like the font size and feel.
Now ask how tall the text is at any screen width—answers come back in a blink, perfect for rotations or dynamic layouts.
Use ready-made text boxes in lists, chats, or creative designs where text dances around images or obstacles.
Your app now feels incredibly responsive with text that reflows smoothly everywhere, delighting users.
Star Growth
Repurpose is a Pro feature
Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.
Unlock RepurposeSimilar repos coming soon.