Hacker News new | ask | show | jobs
by Hamuko 714 days ago
Annoyingly enough you don't really all keyboard shortcuts out of the box even if you build natively. If you create a Button(role: .destructive).keyboardShortcut(.defaultAction) in a SwiftUI dialog, you don't get Cmd+D as the shortcut even though Finder (and I think other apps too) uses Cmd+D as the keyboard shortcut for destructive confirmation dialogs. Thankfully at least a Button without destructive role will get Enter as its keyboard shortcut in the same context.
1 comments

Yeah for now I keep most of my usage of SwiftUI restricted to non-Mac platforms. On macOS it’s fine for smaller bits like collectionview cells but has a number of rough edges for more major use cases.