Comment by 90s_dev
1 day ago
> // Custom TextField wrapper that supports keyboard shortcuts
> struct FocusableTextField: NSViewRepresentable {
Did things change? We used to use "responder chains" to do this. In fact that concept was created to avoid having to subclass for keyboard shortcuts.
SwiftUI uses a different event handling model than AppKit's responder chain. This NSViewRepresentable approach is afaik the recommended way to access AppKit's event handling capabilities from SwiftUI.
https://developer.apple.com/documentation/swiftui/nsviewrepr...