V.4 Chapter 6: Keyboard and Form Tuning $userManager

Hello,
On the chapter 6 (page 184) I need to bind the Textfield text with $userManager, which I was never mention before on this chapter or the previous ones.

The $userManager (based on the final project) is:

@EnvironmentObject var userManager: UserManager.

But I think it would be nice if the @authors could explain this piece of code that apparently appears from nowhere, especially the @EnvironmentObject (maybe a page is missing?)

OR
Maybe the @authors made a mistake by mention and adding a future property $userManager.profile.name instead the actual property already there:

@State var name: String = ""

Thanks.

@Audrey @jeden please see above

After reading further, it is an error on Page 184:

instead of:

TextField("Type your name...", text: $userManager.profile.name)

should be

TextField("Type your name...", text: $name)
1 Like