how make sure email field has text ending @companyname.com wont proceed if ends @gmail.com?
@ibaction func login(_ sender: any) { if self.emailfield.text != "" || self.passwordfield.text != "" && self.emailfield.text == //what put here?// { } }
one option use hassuffix(:)
check particular suffix.
@ibaction func login(_ sender: any) { if self.emailfield.text != "" || self.passwordfield.text != "" && self.emailfield.text.hassuffix("@companyname.com") { } }
Comments
Post a Comment