Created
October 20, 2018 14:39
-
-
Save KanshuYokoo/b2b076bc5fc7dc4dd5a66bf99ff8268a to your computer and use it in GitHub Desktop.
empty check of UITextField, iOS Swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IBOutlet weak var field1: UITextField! | |
if(field1.text?.isEmpty ?? true) { | |
// field is empty | |
return true | |
} else { | |
// field is NOT empty | |
return false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment