cover

macOS by Tutorials

by Sarah Reichelt

Edition 3.0, December 2024
Copyright © 2024 Sarah Reichelt.

Notice of Rights

All rights reserved. No part of this book or corresponding materials (such as text, images, or source code) may be reproduced or distributed by any means without prior written permission of the copyright owner.

Notice of Liability

This book and all corresponding materials (such as source code) are provided on an “as is” basis, without warranty of any kind, express of implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in action of contract, tort or otherwise, arising from, out of or in connection with the software or the use of other dealing in the software.

Trademarks

All trademarks and registered trademarks appearing in this book are the property of their own respective owners.

Attribution

The author originally created portions of this work for the benefit of Kodeco, a community of developers who love to share their knowledge with the world. www.kodeco.com

License

By purchasing macOS by Tutorials, you have the following license:

  • You are allowed to use and/or modify the source code in macOS by Tutorials in as many apps as you want, with no attribution required.

  • You are allowed to use and/or modify all art, images and designs that are included in macOS by Tutorials in as many apps as you want, but must include this attribution line somewhere inside your app: “Artwork/images/designs: from macOS by Tutorials.

  • The source code included in macOS by Tutorials is for your personal use only. You are NOT allowed to distribute or sell the source code in macOS by Tutorials without prior authorization.

  • This book is for your personal use only. You are NOT allowed to sell this book without prior authorization, or distribute it to friends, coworkers or students; they would need to purchase their own copies.

All materials provided with this book are provided on an “as is” basis, without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

All trademarks and registered trademarks appearing in this guide are the properties of their respective owners.

Preface

Welcome to the third edition of macOS by Tutorials.

The first edition of this book was published in April 2022 and a lot has changed in the Swift and SwiftUI world since then. macOS itself has also seen a lot of changes with the release of macOS Ventura, Sonoma, and now Sequoia, and there have been lots of improvements to Xcode.

In 2023, Kodeco (formerly raywenderlich.com) changed their approach from being similar to a library to becoming more like a school or college. Sadly, this meant that they were no longer going to publish books like this one. However, since it is now out-of-catalog, they have allowed me to take over the book and publish in my own name. They have since reversed their stance on publishing, so you can expect to see more Kodeco books in the future.

I’d like to acknowledge their assistance and pay tribute to the editors who worked with me on the original edition: Richard Critz, Audrey Tam and Ehab Amer. Special mention to Manda Frederick who was the book manager for the first edition and without whom, this book would never have been written. Also a big thank you to Matt Derrick, former CEO of Kodeco, who agreed to and arranged the transfer of this book to me.

The major changes in this edition include:

  • Updated projects to include new features introduced in macOS 15 Sequoia and Xcode 16.

  • More granular chapter organization. The table of contents is now more of an index so you can find the sections you need, with each chapter being more focussed on a single topic.

  • All projects use Xcode’s folder structure.

  • Tabs use the new syntax.

  • Previews use the new @Previewable macro.

  • Tracking the active window uses the @Entry macro.

  • The app in section 4 demonstrates the new windowing options.

I hope you enjoy this updated edition of macOS by Tutorials.

About the Author

I got hooked onto trying to make computers do what I told them a very long time ago and have never stopped loving it. I’m a keen evangelist for developing native Mac apps. When not at my computer, I love coffee, puzzles, reading and cooking — the day hasn’t started until the first cup of coffee is drunk and the crossword is done! — Sarah