macOS by Tutorials Book Review
I received a review copy of the new version of Sarah Reichhelt’s macOS by Tutorials book and decided to share details about the book so you can determine if it’s right for you.
Who the Book is for
The book is written for people with some iOS development experience who want to learn to make Mac apps with SwiftUI. AppKit developers who want to get up to speed with SwiftUI would also benefit from this book.
The book assumes the reader knows some Swift and SwiftUI. Someone with no programming experience would need to learn the basics of Swift before going through the book.
Book Contents
The title of the book gives away what the book covers. You create four Mac apps in the book, three SwiftUI apps and an AppKit menu bar app, and the book uses a tutorial format to teach the material. You learn by building the apps. The projects are available on GitHub for you to view and to check for any mistakes you might make following the tutorials.
The final section of the book covers how to distribute your Mac app.
The projects have been tested and run on both Xcode 15 and 16.
What the Book Doesn’t Cover
- SwiftData
- Core Data
- The Observable framework
The First SwiftUI App
The first app you build in the book is On This Day, an app that shows information about events, births, and deaths that occurred on a particular date. You build the app over five chapters.
The first chapter covers the design of the data model for the app. Topics covered in the chapter include the following:
- Fetching data from the network
- Decoding JSON
- Saving JSON to a local file
The second chapter is where you start building the user interface for the app. The app uses a navigation split view with a sidebar and detail area. Topics covered in the chapter include the following:
- Building a sidebar
- Building a card view to display events
- Building a grid to display cards
- Creating multiple windows
In the third chapter you add a toolbar to the window and add menus to the app. Topics covered in the chapter include the following:
- Adding a menu to the menu bar
- Adding menu items to an existing menu
- Using a picker as a menu item
- Adding a search field to the toolbar to filter what appears in the detail view
The fourth chapter covers using tables and custom views. Topics covered in the chapter include the following:
- Getting the app to show the event data as a table or grid
- Using the
@SceneStorage
property wrapper to save settings for each window - Adding an inspector
- Creating a custom date picker to let people choose a date to view events
The final chapter covers the following topics:
- Adding a preferences window to the app
- Adding an app icon
- Customizing the app’s About box
- Replacing the default Help menu item with an item that takes you to a website
The Menu Bar App
The second app you create in the book is a Pomodoro timer menu bar app. You build the app over three chapters.
In the first chapter you convert the standard AppKit app project to a menu bar app. A big part of the chapter is adding the menu items to the menu bar. Topics covered include the following:
- Adding menu items in a storyboard
- Adding dynamic menu items in code
- Using custom views in menu items.
The second chapter covers working with timers, alerts, and notifications. You will learn how to start and stop pomodoro tasks.
In the final chapter you learn how to add your own tasks to the app.
The Document-Based App
The third app you create in the book is a Markdown editor with live preview. You build the app over two chapters.
The first chapter covers the following topics:
- Creating and configuring a document-based app
- Adding a Swift package to a project
- Using AppKit views in a SwiftUI app
The second chapter focuses on adding menu controls to the app. The chapter covers the following topics:
- Adding a menu to the app to show the HTML using a CSS stylesheet
- Adding menu items that are specific to a single window
- Exporting a document to a file
The Final App
The final app you build is an app that provides a GUI for the sips
Terminal command. The sips
command manipulates images. You build the app over three chapters.
The first chapter introduces you to the Terminal and shows you how to use the Process
class to run Terminal commands from a Mac GUI app.
In the second chapter you build the user interface for the app. The chapter covers the following topics:
- Opening files with SwiftUI’s file importer
- Dragging and dropping files and folders to a SwiftUI view
The final chapter covers adding support for macOS automation features to the app. The chapter covers the following topics:
- Creating a service that can be accessed from the macOS Services menu
- Creating an app intent that can be used by the Shortcuts app or Siri
Distributing Your App
The final two chapters of the book cover how to distribute your Mac apps so other people can use them. The first chapter covers how to put your app on the Mac App Store.
The second chapter shows you how to distribute your app outside the Mac App Store. You learn how to notarize your app and create a DMG disk image for your app.
Should You Buy This Book?
I recommend buying the book under the following conditions:
- You want to learn how to make SwiftUI Mac apps
- You know some Swift
- You like learning through tutorials where you build apps