How to bottom of textview via animation

My code below scrolls to the top of the textview. The command is .zero. What is the command using this same format to go to the end or bottom of the textview. What is the opposite of .zero?

         self.theTextView.contentOffset = .zero

Hi @timswift

The contentOffset is type of CGPoint. So you need to create such CGPoint that will scroll to the bottom of the textView, probably something like this:

yourTextView.contentOffset = CGPoint(x: 0, y: yourTextView.contentSize.hight)

Nikita

This topic was automatically closed after 166 days. New replies are no longer allowed.