Is there a way to detect line breaks occurred by the user or when the textview automatically changes line. I am going to change the height of the textview depending on the number of lines.
Any help appreciated.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the method proposed in this answer to find the occurrences of @”\n”, the newline character.
You can see if the string change using the textViewDidChange: protocol method (apple doc here).
If you want the heigh, directly, look at this answer. I think it can help.