Detect moment when newline starts in UITextView
问题 I try to detect when carriage goes at new line in UITextView. I can detect it by comparison total later width with UITextView width: CGSize size = [textView.text sizeWithAttributes:textView.typingAttributes]; if(size.width > textView.bounds.size.width) NSLog (@"New line"); But it dose not work proper way because -sizeWithAttributes:textView returns only width of letters without indentation width. Help please solve this. 回答1: This is how I would do it: Get the UITextPosition of the last