I'm new to iOS development. I'm practicing linking actions/outlets between the View and Controller. My problem is that I don't know why it shows me some errors. Could you please take a look at my code and tell me what I'm missing?
I receive the following errors:
Value of optional type 'String?' must be unwrapped to a value of type 'String'
Coalesce using '??' to provide a default when the optional value contains 'nil'
Force-unwrap using '!' to abort execution if the optional value contains 'nil'
Here's the code:
@IBAction func submitAppointmentDetails(_ sender: Any) {
appointmentSetName.text = "Congratulations," + nameField.text + "You have now set up an appointment with us!"
}
A photo of what's going on: https://i.stack.imgur.com/nRzQW.jpg
Edit: @matt This is a different question because the thread you thought this is a duplicate of doesn't have the solution that I was seeking, but two people in this thread did give me the solution. I never would have found the solution if I just read the thread that you shared.