Just as the SwiftUI framework has continued to evolve ever since Apple debuted it in 2019, we’ve continued to update SwiftUI by Tutorials, our premiere book on building modern, declarative UI, right alongside!
In this Third Edition update, we’ve taken a lot of cues from you, our reader, on how you’ve been using SwiftUI in your own projects, as well thinking towards solutions to real-world problems you face when trying to leverage SwiftUI in the most efficient and elegant way possible.
We’ve also updated a number of the apps in the book with some fresh, new SwiftUI-inspired designs, to show you everything you can achieve when building fluid, responsive UI.
So we’re excited to announce that SwiftUI by Tutorials is now fully updated, with new apps and new chapters, and is out today in its Third Edition! It’s truly your best, most complete guide to building fluid and engaging declarative UI for your apps — using less code than you thought possible.
Keep reading to see what’s inside, and how you can get your copy today!
What is SwiftUI by Tutorials?
SwiftUI by Tutorials is designed to help you learn how to transition from the “old way” of building your app UI with UIKit, to the “new way” of building responsive UI with modern declarative syntax with SwiftUI.
What’s more is that SwiftUI lets you build modern, responsive UI and animations for all Apple devices — not just iOS. So whether you’re building apps for iOS, watchOS, tvOS, macOS, or any other Apple platform, you can use the same concise, natural language to describe your UI and have it look stunning — no matter where your code runs.
Who is this Book For?
This book is for readers who are comfortable building Swift apps, and want to make the exciting leap into building their app UI with modern, declarative code.
It’s also for advanced developers who want to dive deeper into the nuances of SwiftUI, and build more complex interfaces, use custom gestures, or even go the distance and port iOS apps to macOS!
What’s Inside SwiftUI by Tutorials?
We’ve completely overhauled this edition of the book — and when you check out the book, you’ll see this immediately! We’ve rewritten existing chapters, updated every section, added new chapters, and reorganized content to help you find precisely the information you’re looking for.
SwiftUI by Tutorials takes you from SwiftUI novice to expert over 21 massive chapters, spanning six sections:
Section I: Diving Into SwiftUI
Start your SwiftUI journey with the foundations you need!
- Introduction: In this chapter, you’ll get an overview of the book as a whole, as well as the apps you’ll be building as you learn the fundamentals of SwiftUI!
- Getting Started: Get started with SwiftUI! Learn about the basic terminology, and discover the power of building your interface directly in the preview canvas. Check how SwiftUI makes declarative development easy and straightforward, and how you can drag and drop as you used to do with storyboards.
- Diving Deeper Into SwiftUI [New!]: SwiftUI’s declarative style makes it easy to implement eye-catching designs. You can create reusable modifiers to unify your design. In this chapter, you’ll implement a neumorphic Figma design for RGBullsEye.
- Testing & Debugging: We all know how important testing is in modern application development. See how to apply UI Testing to your SwiftUI apps in this very simple, yet powerful chapter.
Section II: Building Blocks of SwiftUI
- Intro to Controls – Text & Image: Learn how to add and configure different SwiftUI controls within your apps. Discover modifiers in a practical way and how they can be shared across controls or used individually. Get an introduction to container views and how to use them with SwiftUI.
- Controls & User Input: Discover some of the most common controls in user interfaces such as TextFields, Buttons, Toggles, Sliders and Steppers, and how to use them with SwiftUI.
- Introducing Stacks & Containers: Dig in to the powerful capabilities of vertical and horizontal stacks. See how easy it is to apply them to your app layout and to nest them to generate almost any possible combination. Stacks are back, stronger than before, and will for sure become a game-changer in SwiftUI.
Build on what you’ve learned in Section I to begin using SwiftUI in more complex and advanced apps.
Section III: State & Data Flow
Learn how your user interface reacts to data flow and state changes.
- State & Data Flow — Part I [New!]: Learn how to bind data to the UI, how reactive updates take place in the UI through state management, and gain in-depth usage of the attributes related to SwiftUI.
- State & Data Flow – Part II [New!]: In the previous chapter you learned how to use @State and @Binding, and the power they provide in a transparent and easy to use way. In this chapter, you’ll learn about other tools that allows you to make your own types efficiently reactive — or reactively efficient!
- More User Input & App Storage [New!]: In this chapter, you will expand your knowledge by learning more advanced input controls like calendar and color pickers. You will also get to know how to persist the information with an overview of App Storage.
- Gestures: Learn how to trigger updates on the interface, including how to easily test a SwiftUI interface, how to manage the flow of screens throughout a complex app, and how to deal with gestures, including the development of a custom gesture.
- Accessibility [New!]: Learn how to navigate your app with VoiceOver on an iOS device and use the SwiftUI Accessibility API attributes to improve your app’s accessible UI. You’ll add labels that provide context for UI elements and improve VoiceOver information by reordering, combining or ignoring child elements.
Section IV: Navigation & Data Display
Move through your app screens with SwiftUI and discover how to display data in them.
- Navigation [New!]: You’ll learn about different methods of allowing your user to navigate between views in your app, creating a navigation hierarchy, and using tabbed navigation to display information.
- Lists [New!]: Displaying lists of data is a must in almost any app. Here you will learn how to deal with all sorts of lists to get the best out of them.
- Grids [New!]: In this chapter, you’ll explore the new grid functionality in SwiftUI and use it to create more flexible and complex layouts with less effort than using stacks.
- Sheets & Alert Views [New!]: Sometimes, depending on certain conditions, you might need to show or hide a view. Think of an alert message, for example. You can use these to focus the users’ attention and request immediate feedback from them.
Section V: UI Extensions
Push forward your SwiftUI knowledge with complex interfaces and by implementing animations and custom graphics.
- Drawing & Custom Graphics: Learn how to draw with the use of paths, shapes and geometry. Follow along to design your own elements.
- Animations & View Transitions: Explore the basic concepts for animating views using SwiftUI. Learn how to apply animations to view transitions, how to animate state changes, and how to combine and chain those animations.
- Complex Interfaces: In this chapter, you will learn how to develop more complex interfaces. Get out of your comfort zone and dive into more advanced concepts that will allow you to generate almost any UI you can imagine. You’ll learn the limitations you may find while developing advanced SwiftUI interfaces.
Section VI: SwiftUI for macOS
In this brand-new section, learn how to implement everything you know about SwiftUI in a macOS desktop applications.
- Building a Mac App [New!]: Learn how to create a document-based Mac app. Understand how to handle different file types and how to use a variety of standard Mac UI elements.
- Converting an iOS App to macOS [New!]: Start with an existing iOS app, and learn how to reuse code, views and assets for creating a macOS app. Find out what works as-is, and what needs to be changed for the Mac!
About the Authors
Of course, our book would be nothing without the massive skills of our talented authors:
Antonio Bello is an author of this book. Antonio has spent most of his life writing code, and he’s gained a lot of experience in several languages and technologies. A few years ago he fell in love with iOS development, and that’s what he mostly works on since then, although he’s always open for challenges and for playing with new toys. He believes that reputation is the most important skill in his job, and that “it cannot be done” actually means “it can be done, but it’s not economically convenient.” When he’s not working, he’s probably playing drums or making songs in his small, but well fitted, home recording studio.
Bill Morefield is an author of this book. Bill has spent most of his professional life writing code. At some point he has worked in almost every language other than COBOL. He bought his first Apple computer to learn to program for the iPhone and got hooked on the platform. He manages the web and mobile development team for a college in Tennessee, where he still gets to write code. When not attached to a keyboard he enjoys hiking and photography.
Audrey Tam is an author of this book. As a retired computer science academic, she’s a technology generalist with expertise in translating new knowledge into learning materials. Audrey now teaches short courses in iOS app development to non-programmers, and attends nearly all Melbourne Cocoaheads monthly meetings. She also enjoys long train journeys, knitting, and trekking in the Aussie wilderness..
Sarah Reichelt is an author of this book. She got hooked onto trying to make computers do what she told them a very long time ago and has never stopped loving it. She was inspired by Swift and now by SwiftUI to learn a new approach to this, and is a keen evangelist for developing Mac apps. When not at her computer, Sarah loves coffee, puzzles, reading and cooking – the day hasn’t started until the first cup of coffee is drunk and the crossword is done!
Where to Go From Here?
SwiftUI by Tutorials, Third Edition is fully updated with new content, and available today! Like every one of our books, SwiftUI by Tutorials has been automatically added to the collections of all Ultimate Pro subscribers!
Want your own copy of SwiftUI by Tutorials? There are two ways you can enjoy this book:
- Buy it individually: If you want to build up a custom library without a subscription, you can choose to buy the book individually. It’s available now for just $59.99 in our online store.
- Get it as part an Ultimate Pro book and video subscription: Enjoy access to our videos and mobile development books in our Ultimate Pro subscription, including SwiftUI by Tutorials! Right now, you can get a full year’s Ultimate Pro subscription and save 20% off the cost of a regular monthly subscription. It’s simply the best investment for your mobile development career.
We hope you enjoy this completely revamped and reorganized edition of SwiftUI by Tutorials. On behalf of the book team, thank you for your support!