Chapter 7: Food Delivery Part 2 – Working with Forms

What you’ll learn in this chapter:

  • Extending our Food Delivery App with an order sheet
  • Working with Forms in SwiftUI
  • Implementing user controls
  • Creating Modal views and Confirmation dialogs
  • How to implemnt native icons using SFSymbols
  • Direct the user’s attention using Focus

What we’ll create 🚀

In this chapter, we will extend our Food Delivery App with another view. This view contains an order sheet that is presented when the user taps the “Order”-Button.

By building this order sheet, we’ll learn how to use controls like Toggles, Sliders, and Steppers for providing a better user experience. We’ll also learn how to cluster views by using Forms and Sections. We’ll present this new order sheet as a so-called model view. Finally, we’ll learn how to control the user’s attention by using the @FocusState property wrapper.

Let’s open our Food Delivery project again and create a new SwiftUI file. We name this new file OrderForm. In this file, we implement all the control views such as Toggles, TextFields, Sliders, etc. we need for our user to order a certain food. Make sure you delete the default Text view and the related .padding modifier again.

Leave a Reply

Your email address will not be published. Required fields are marked *