A simple, production-ready SwiftUI text expander for macOS
Features • Installation • Architecture • Resources
Text Forge is a SwiftUI text expander that showcases how to build modern macOS apps while maintaining excellent backwards compatibility (macOS 13.3). Built with Swift 6’s strict concurrency, it’s both a working app and a practical reference for developers.
Whether you’re figuring out Core Data with CloudKit sync, building custom inspectors for older macOS versions, or bridging NSTextView into SwiftUI, Text Forge demonstrates patterns you can use with ease in your own projects.
- 📝 Rich Text Editing — Full-featured text editor with tokenized input using NSTextView
- ☁️ iCloud Sync — Seamless document synchronization via Core Data + CloudKit
- 🎨 Markdown Support — Native markdown styling with AttributedString formatting
- 💰 In-App Purchases — Complete StoreKit 2 integration for tips and premium features
- 🔤 System Font Picker — Native font selection through NSFontManager
- Swift 6 Strict Concurrency — Built with default isolation on the
@MainActor - Backwards Compatibility — Supports macOS 13.3+ while leveraging modern APIs where available
- Best Practices — Simple, tested solutions for common macOS development challenges
Text builder interface
Template builder interface with text tokens and custom inspector
Settings screens
- macOS 13.3 or later
- Xcode 26.0 or later
- Swift 6.0 or later
Before building, set:
DEVELOPMENT_TEAM— your Apple Team IDBUNDLE_ID_PREFIX— your reverse‑domain prefix (e.g.com.example)
Open the project in Xcode 26 or later and run on "My Mac".
Here are some of the techniques you’ll encounter in Text Forge:
The entity hierarchy is decoupled from the class hierarchy, so you get model inheritance without creating massive database tables. Great for offline-first apps that need cloud sync.
Since .inspector() works only on macOS 14+, Text Forge demonstrates how to build the same experience using HSplitView for older systems. Works all the way back to macOS 13.3.
Learn how to wire up menu commands without passing bindings through every view. Uses SwiftUI’s focus property wrappers to keep things clean.
Need floating utility windows but can’t require macOS 15? See how to bridge AppKit’s NSPanel into your SwiftUI app.
Bridges NSTextView into SwiftUI with all the good stuff:
- Interactive inline tokens via
NSTextAttachmentCell - Keyboard navigation and selection
Complete in-app purchase implementation with:
- Product loading and caching
- Purchase restoration
- Error handling and user feedback
- Example Tip Jar implementation
- Core Data Models and Model Objects — Advanced Core Data patterns
- Pill — Tokenized text field inspiration
- Floating Panel — Floating window inspiration
For projects targeting newer macOS versions:
- SwiftUI Inspectors — macOS 14+ inspectors
- SwiftUI Mac Windows — macOS 15+ window management
Text Forge is available under the MIT License. See LICENSE file for details.
App icon by the exceptionally talented Matthew Skiles
