Supporting macOS

The great news is that, as of macOS Big Sur, a single SwiftUI app can be deployed to both iOS and macOS. From the scheme selector at the top of Xcode’s window, switch to the TahDoodle (macOS) scheme. Build and run, and TahDoodle will launch on your Mac (Figure 28.18, “TahDoodle on macOS”).

Figure 28.18. TahDoodle on macOS
TahDoodle on macOS

It launches, but it is much wider than necessary.

Unsurprisingly, developing for macOS introduces specific concerns and interaction paradigms that you should take into account. For example, apps can create windows of different sizes. As with any app development project, you would want to work with your users ...

Get Swift Programming: The Big Nerd Ranch Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.