1

i have UITextView which is inside the tableview cell, and when i click on the "NO" option , the cell will expand , i need to pass the both text which is entered in the textview and image which is uploaded here,

But the problem is am not able to validate the textview, whether it is empty or not,

i should check whether it is empty or not, and if it is empty is need to alert the message. enter image description here

Maulik Pandya
  • 2,200
  • 17
  • 26
Purushothaman
  • 358
  • 4
  • 22

1 Answers1

3

Set the table view cell containing your text as a custom table view cell. When you do that, you can connect your UITextView to an outlet.

Once you do that, it's easy to check by simply looking at the length of the .text property for that outlet.

e.g. something like:

(for Swift):

if myTextView.text.characters.count > 0
{
   // there is something in here
}
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215