SwiftUI Keyboard Shortcuts and macOS Menu Bar.

Luca Jonscher
ITNEXT
Published in
2 min readAug 8, 2020

--

With SwiftUI 2, it’s incredibly easy to add keyboard shortcuts to actions and to add buttons to your app’s menu bar.

Keyboard Shortcut

You can add keyboard shortcuts to actions simply by adding .keyboardShortcut(_:) to the button:

--

--

Writer for

Designer, Developer, Creative. Freelance graphic designer. From Germany. Thrice Apple Swift Student Challenge winner.