0

I'm trying to insert a long non editable text using TextView in Swift. No problem with length or vertical scrolling. The problem is that when UIView starts I can't see text from the beginning but I always see the final part.

I attached 2 images: how it looks and how it should be.

HOW IT LOOKS

HOW IT SHOULD BE

Anton O.
  • 653
  • 7
  • 27

2 Answers2

1

Follow the hint posted by Nate Mann, I found the solution.

It's correct: myTextview.scrollRangeToVisible(NSMakeRange(0,0))

but you have to put in viewDidAppear:

override func viewDidAppear(animated: Bool) {
     myTextView.scrollRangeToVisible(NSMakeRange(0, 0))
}
0

try mytextView..scrollRangeToVisible(NSMakeRange(0, 0))

put this in viewDidLoad()

Nate Mann
  • 695
  • 6
  • 17