Every new line add a numbered list UITextView
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to add a number to the beginning of each row whenever the user enters a newline. I'd like the numbers to go in order (like in an ordered list), but with my current code, if the user does not add a new line at the end but instead adds the line in the middle of the UITextView , it will continue counting from where it left off at the bottom -- meaning that the NSUInteger I made increments and doesn't take into account that the user did not make the new line at the end. - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange: