Bit of a battle, but have managed to come up with an approach that with a little bit of more polishing can do a reasonable approximation of an idiomatic macOS text editing experience in pure SwiftUI (and is only (of necessity) slightly hacky).
A demo of this approach and an explanation of how it works can be found over on GitHub at https://github.com/shufflingB/swiftui-macos-undoable-texteditor.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: