Getting User Input from TextField

Hello everyone,

I'm new to swift language and xcode, and I've been stuck on this problem for weeks.

How can I get user input (from a textField) and turn it into a variable that I can use in my code?

Thank you.
Code Block swift
TextField("Name", text: $text)


Also make sure that your variable is declared like this:
Code Block Swift
@State private var text = ""

Getting User Input from TextField
 
 
Q