Author Topic: How to get a text view to scroll to the top after setting its text property  (Read 1927 times)

kjmcneish

  • Administrator
  • *****
  • Posts: 719
    • View Profile
To get a text view to scroll to the top of the content after setting its text property, do the following:

Code: [Select]
self.textView.scrollRangeToVisible(NSMakeRange(0, 0))
All the best!
Kevin McNeish
Author of "Learn to Code in Swift": https://itunes.apple.com/us/book/learn-to-code-in-swift/id942956811?mt=11
« Last Edit: September 02, 2015, 05:34:58 AM by kjmcneish »