Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
SwiftUI Cookbook

You're reading from   SwiftUI Cookbook A guide for building beautiful and interactive SwiftUI apps

Arrow left icon
Product type Paperback
Published in Dec 2023
Publisher Packt
ISBN-13 9781805121732
Length 798 pages
Edition 3rd Edition
Languages
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Juan C. Catalan Juan C. Catalan
Author Profile Icon Juan C. Catalan
Juan C. Catalan
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Using the Basic SwiftUI Views and Controls FREE CHAPTER 2. Displaying Scrollable Content with Lists and Scroll Views 3. Exploring Advanced Components 4. Viewing while Building with SwiftUI Preview in Xcode 15 5. Creating New Components and Grouping Views with Container Views 6. Presenting Views Modally 7. Navigation Containers 8. Drawing with SwiftUI 9. Animating with SwiftUI 10. Driving SwiftUI with Data 11. Driving SwiftUI with Combine 12. SwiftUI Concurrency with async await 13. Handling Authentication and Firebase with SwiftUI 14. Persistence in SwiftUI with Core Data and SwiftData 15. Data Visualization with Swift Charts 16. Creating Multiplatform Apps with SwiftUI 17. SwiftUI Tips and Tricks 18. Other Books You May Enjoy
19. Index

To get the most out of this book

Inform the reader the things that they need to know before they start: spell out what knowledge you are assuming. Tell the reader anything they need to know before they start.

This book has been completely revised for Swift 5, iOS 17, Xcode 15, and Swift 5.9.

To build all the apps in this book, you will need:

  • A Mac computer running macOS Ventura 13.5 or later. For Chapter 16, you’ll need macOS 14.0 Sonoma or later.
  • Xcode 15.0 or later.

The book extensively uses the live preview of the Xcode canvas to introduce the learning material and occasionally uses the iOS simulator. If you want to test the apps on your iPhone or iPad, you will need to obtain a free Apple Developer account from Apple at https://developer.apple.com.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you to avoid any potential errors related to the copying and pasting of code.

Download the example code files

The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/SwiftUI-Cookbook-3rd-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781805121732.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example: “Mount the downloaded WebStorm-10*.dmg disk image file as another disk in your system.”

A block of code is set as follows:

Chart {
    ForEach(data) { entry in
        BarMark(
            x: .value("Question", entry.question),
            y: .value("Count", entry.count)
        )
    }
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

struct TodoItem: Identifiable {
    let id = UUID()
    var title: String
}

Bold: Indicates a new term, an important word, or words that you see on the screen. For instance, words in menus or dialog boxes appear in the text like this. For example: “Tap on the + button a few times and then on the Refresh button”.

Warnings or important notes appear like this.

Tips and tricks appear like this.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it..., How it works..., There’s more..., and See also).

To give clear instructions on how to complete a recipe, use these sections as follows:

Getting ready

This section tells you what to expect in the recipe and describes how to set up any software or any preliminary settings required for the recipe.

How to do it…

This section contains the step-by-step instructions required to build the app of the recipe. Screenshots and explanatory figures are provided along with the code snippets.

How it works…

This section usually consists of a detailed explanation of the steps followed in the previous section. It explains in detail the code snippets and technologies used in the recipe.

There’s more…

This optional section covers additional topics related to the recipe to make you more knowledgeable about the technologies used to build the app.

See also

This optional section provides helpful links to other useful information about the technologies used in the recipe.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime