Skip to content

A SwiftUI snippet manager that demonstrates how to build a modern, elegant macOS app with excellent backwards compatibility and few compromises.

License

Notifications You must be signed in to change notification settings

JPToroDev/TextForge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

text-forge-app-icon

Text Forge

A simple, production-ready SwiftUI text expander for macOS

Swift 6.0 macOS 13.3+ MIT License

FeaturesInstallationArchitectureResources


🛠️ Overview

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.

✨ Features

Core Functionality

  • 📝 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

Developer Highlights

  • 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

📸 Screenshots

Text builder interface
Text builder interface

template builder interface with text tokens and custom inspector
Template builder interface with text tokens and custom inspector

settings screens
Settings screens

🚀 Installation

Requirements

  • macOS 13.3 or later
  • Xcode 26.0 or later
  • Swift 6.0 or later

Building from Source

Before building, set:

  1. DEVELOPMENT_TEAM — your Apple Team ID
  2. BUNDLE_ID_PREFIX — your reverse‑domain prefix (e.g. com.example)

Open the project in Xcode 26 or later and run on "My Mac".

🏗 Architecture

Here are some of the techniques you’ll encounter in Text Forge:

📱 Core Data with CloudKit Sync

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.

🎛️ Custom Inspector using HSplitView

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.

⌘ Menu Commands with @FocusedObject

Learn how to wire up menu commands without passing bindings through every view. Uses SwiftUI’s focus property wrappers to keep things clean.

🪟 Floating Panels using NSPanel

Need floating utility windows but can’t require macOS 15? See how to bridge AppKit’s NSPanel into your SwiftUI app.

✏️ Advanced Text Editor

Bridges NSTextView into SwiftUI with all the good stuff:

  • Interactive inline tokens via NSTextAttachmentCell
  • Keyboard navigation and selection

💳 StoreKit 2 Integration

Complete in-app purchase implementation with:

  • Product loading and caching
  • Purchase restoration
  • Error handling and user feedback
  • Example Tip Jar implementation

📚 Resources

For projects targeting newer macOS versions:

📄 License

Text Forge is available under the MIT License. See LICENSE file for details.

🙏 Acknowledgments

App icon by the exceptionally talented Matthew Skiles

About

A SwiftUI snippet manager that demonstrates how to build a modern, elegant macOS app with excellent backwards compatibility and few compromises.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages