I would suggest you the ilyapuchka ReadMoreTextView library , which is located at this link. This is the easiest way to achieve this, and it is light weight.
You can install it using CocoaPods, just pod 'ReadMoreTextView'put it into the podfile, and you can use it:
let textView = ReadMoreTextView()
textView.text = "Lorem ipsum dolor ..."
textView.shouldTrim = true
textView.maximumNumberOfLines = 3
textView.trimText = "Read more"
source
share