I wonder how I proper check if a uitextview is empty.
Right now I have a validation fucntion which does the check:
if let descText = myTextView.text {
if descText.isEmpty {
descErrorLabel.isHidden = false
} else {
descErrorLabel.isHidden = true
}
}
It this enough to prevent the user from sending an empty textview or must I check of whitespaces also, something like:
stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()).isEmpty