Coding in Swift for the first time. I keep getting a "Value of optional type 'String?' not unwrapped" error on the line where I declare the condition for the if
statement. What am I doing wrong?
@IBAction func registerButtonTapped(sender: AnyObject) {
let userName = userNameTextField.text;
let userPhoneNumber = userPhoneNumberTextField.text);
let userPassword = userPasswordTextField.text;
let userReenterPassword = userReenterPasswordTextField.text;
// Check for empty fields
if(userName.isEmpty || userPhoneNumber.isEmpty || userPassword.isEmpty)
{
//Display alert message
return;
}