I’m trying to build a login page for an app. Something went wrong when testing the login condition.
There are two textfields, username and password. When the Login button is clicked, alert shows when

1) either fields are empty
2) both filled.

The code reflects this below. But the result came out no matter that the textfield is empty or not, it only showed as textfields were filled ( only the else part run). So I assume there was something wrong with the if condition. But when I checked the if condition in other view, it worked.