The method I wanted was NSTextStorage edited(_:range:changeInLength:)
Post
Replies
Boosts
Views
Activity
If anyone else with the same problem ever stumbles upon this post, my workaround is just to work with the WindowGroup in the Scene so I can use previews and get error warnings, and then comment it out when i want to actually build and run the app
@main
struct MyApp: App {
@State var document: TextDocument = TextDocument()
var body: some Scene {
WindowGroup {
NavigationStack {
ContentView(document: $document)
}
}
DocumentGroup(newDocument: TextDocument()) { file in
ContentView(document: file.$document)
}
}
}