The way you call your AccountRegistrationView information on your ConfirmationView it will always return a copy of the AccountRegistrationView with all the info as per their initial values i.e.
userName = ""
email = ""
pass = ""
What you need to is place the variables to be updated in your ConfirmationView as variables, see below:
struct ConfirmationView: View {
var userName: String
var email: String
var pass: String
var body: some View {
Text("User name: \(userName)")
.multilineTextAlignment(.center)
.padding(.all, 20.0)
Text("Email address: \(email)")
.multilineTextAlignment(.center)
.padding(.all, 20.0)
Text("Password: \(pass)")
.multilineTextAlignment(.center)
.padding(.all, 20.0)
}
}
and your NavigationLink should be:
NavigationLink {
ConfirmationView(userName: userName, email: email, pass: pass)
} label: {
Label("Next", systemImage: "arrowshape.forward.fill")
.font(.body)
}