Type Safely

Type Safely

Add Options To The macOS Menu Bar With SwiftUI Commands

Daily Coding Tip 244

Type Safely's avatar
Type Safely
Feb 07, 2023
∙ Paid
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…

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture