I cant seem to find a right solution to autoscroll UITextView
using Swift.
For my app I am receiving constant data from BT, and I am updating it on a UITextView
. However, when the UITextView
will reach the latest updated line, I would have to manually scroll.
What I'm trying to achieve is to keep the last added line to the UITextView
visible. (using swift)
This will scroll to the bottom of a UITextView
, with an animation:
let range = NSMakeRange(textView.text.characters.count - 1, 0)
textView.scrollRangeToVisible(range)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With