-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

SwiftUI Cookbook
By :

Forms provide a means of getting information from the user. Users get discouraged when completing very long forms, yet fewer people submitting a form may mean less data for your surveys, fewer signups for your app, or fewer people providing whatever data you're collecting.
In this recipe, we will learn how to show/hide the additional address section of a form based on the user's input.
Create a new SwiftUI project named SignUp
.
We will create a signup form with sections for various user inputs. One of the sections, additional address, will be shown or hidden based on how long the user has lived at their current address.
The steps are given here:
signUpView
:a. Press Command () + N.
b. Select SwiftUI View.
c. Click Next.
d. Name the view signUpView
.
e. Click Finish.
signUpView
, declare and initialize the @State
variables that will be used in...