Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
SwiftUI Projects

You're reading from   SwiftUI Projects Build six real-world, cross-platform mobile applications using Swift, Xcode 12, and SwiftUI

Arrow left icon
Product type Paperback
Published in Dec 2020
Publisher Packt
ISBN-13 9781839214660
Length 410 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Craig Clayton Craig Clayton
Author Profile Icon Craig Clayton
Craig Clayton
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Chapter 1: SwiftUI Basics 2. Chapter 2: SwiftUI Watch Tour FREE CHAPTER 3. Chapter 3: NBA Draft – Watch App 4. Chapter 4: Car Order Form – Design 5. Chapter 5: Car Order Form – Data 6. Chapter 6: Financial App – Design 7. Chapter 7: Financial App – Core Data 8. Chapter 8: Shoe Point of Sale System – Design 9. Chapter 9: Shoe Point of Sale System – CloudKit 10. Chapter 10: Sports News App – Design 11. Chapter 11: Sports News App – Data 12. Other Books You May Enjoy

The form view

To wrap up the main view, we need to work on the bottom section, which contains the form. You will learn how to customize a generic form. Since SwiftUI is new, we will not be able to customize our form using only SwiftUI. SwiftUI forms are built on top of UITableView, so a lot of our customizations will be made to the table view itself. Let's get started by opening FormView, and before we get started, you will notice this:

@ObservedObject var order = OrderViewModel()

You will see this in a few files throughout this chapter. I have added some basic defaults for this file in OrderViewModel.swift that we will use to get our form working and some other logic we need in this app. This file and the default values are not necessary. We are only using it for prototyping and nothing more. In Chapter 5, Car Order FormData, we will rewrite this code. For now, we are going to just focus on design in this chapter.

Creating the form sections

  1. Inside FormView...
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 $19.99/month. Cancel anytime
Banner background image