Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Add Options To The macOS Menu Bar With SwiftUI Commands
Copy link
Facebook
Email
Notes
More

Add Options To The macOS Menu Bar With SwiftUI Commands

Daily Coding Tip 244

Type Safely's avatar
Type Safely
Feb 07, 2023
∙ Paid

Share this post

Type Safely
Type Safely
Add Options To The macOS Menu Bar With SwiftUI Commands
Copy link
Facebook
Email
Notes
More
Share
command computer keyboard key
Photo by hannah joshua on Unsplash

WindowGroup is the parent of ContentView in the default SwiftUI app.

I’m going to start by creating CommandsView. This is taking advantage of the fact that the implicit @ViewBuilder designation of the body property allows you to pass a bunch of views in with no parent. This means that there is no layout like VStack, so i…

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More