3 ms·
> // Custom TextField wrapper that supports keyboard shortcuts > struct FocusableTextField: NSViewRepresentable { Did things change? We used to use "responder
by 90s_dev 1y 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.
- bobnarizes 1y agoSwiftUI 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/nsviewrepresentable https://developer.apple.com/documentation/swiftui/nsviewrepr...