Learn all about SwiftUI with these posts

SwiftUI is a modern way to declare user interfaces for any Apple platform. Create beautiful, dynamic apps faster than ever before.

New!
How to check if a modifier key is pressed when clicking on a menu bar item in macOS apps

Learn how you can provide different content or functionality when clicking on a menu bar item with a modifier key pressed in macOS apps using both AppKit and SwiftUI.

Using withObservationTracking to monitor changes in @Observable properties outside SwiftUI views

Learn how the Observation module's withObservationTracking function works and how you can use it to observe changes of an @Observable object from anywhere in your codebase.

How to keep your macOS app's menu bar item running after quitting the app

Learn how you can interrupt the app's termination and change your app's activation policy to keep the menu bar item running after the app has been quit.

How to listen for property changes in an @Observable class using AsyncStreams

A comparison between ObservableObject and the new Observable macro and how to listen and react to property changes in both.

How to build a Safari extension with SwiftUI

Learn how to create a Safari Extension as a popover using only Swift and how to render its UI using SwiftUI.

How to pass Bindings to views in SwiftUI's NavigationDestination modifier

Two approaches on how to pass Bindings to views in SwiftUI's NavigationDestination.

How to make ZStack content fully scrollable in a SwiftUI ScrollView

How to calculate the correct content size for a ScrollView when using a ZStack with overlapping views using offsets in SwiftUI.

Show and hide SwiftUI inspectors with an identifiable item

Learn how to create a custom view modifier to overcome the API limitations of SwiftUI inspectors and that allows you to show and hide SwiftUI inspectors with an identifiable item.

How to create a SwiftUI floating window in macOS 15

Leverage the power of the new SwiftUI APIs in macOS 15 to create a movable and resizable floating window that stays on top of every other window

Safely unwrap optional values in SwiftUI bindings

How to use one of SwiftUI's Binding's initializers to safely unwrap its optional value.

Creating an App Store Connect-like picker for macOS with SwiftUI

Learn how to use SwiftUI components such as Menus and Buttons and modifiers like onHover and overlay to create a picker component for macOS similar to the beta group picker in App Store Connect's TestFlight.

Launching a SwiftUI view from the terminal

Learn how to launch a SwiftUI view directly from your Swift command-line tool without making a full-blown macOS application.