I wonder how I correctly check if a uitextview is empty.
Now I have a validation function that performs validation:
if let descText = myTextView.text { if descText.isEmpty { descErrorLabel.isHidden = false } else { descErrorLabel.isHidden = true } }
This is enough to prevent the user from sending an empty text view or I should check for spaces, for example:
stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).isEmpty
source share