Skip to content

martynchamberlin/draft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Draft

A ridiculously simple macOS text editor: one full-window editor that auto-saves locally.

This is a native SwiftUI/AppKit version of the “giant textarea” idea from https://local-edit.netlify.app/.

Screenshot

Screenshot

What it does

  • Single full-window editor (no document model, no tabs, no sidebar)
  • Auto-saves your text locally (using @AppStorage)
  • Cmd+F Find using macOS’s built-in Find UI (via an NSTextView wrapper)
  • Titlebar blends with the editor background (no visible window title)

Requirements

  • macOS (this project targets macOS; see Draft.xcodeproj build settings)
  • Xcode (open the project and run)

Run it

  1. Open Draft.xcodeproj in Xcode
  2. Select the Draft scheme
  3. Run (⌘R)

Notes

  • Where text is stored: the content is saved to your app’s user defaults under the key draft.text.
  • Window title: the title text is intentionally blanked/hidden. (macOS will still show the app name in the system menu bar—this is normal.)
  • Traffic lights: the red/yellow/green window buttons use the standard macOS titlebar layout (no hacks to reposition them).

Code pointers

  • Main editor: Draft/ContentView.swift
  • Find-enabled editor: Draft/FindableTextView.swift (wraps NSTextView so Cmd+F works)
  • Window/titlebar styling: Draft/WindowChromeConfigurator.swift

License

MIT — see LICENSE.

About

A ridiculously simple macOS text editor

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages