I used UITextView with this code:
lazy var commentTextView: UITextView = {
// Create a TextView.
let textView: UITextView = UITextView()
// Round the corners.
textView.layer.masksToBounds = true
// Set the size of the roundness.
textView.layer.cornerRadius = 20.0
// Set the thickness of the border.
textView.layer.borderWidth = 1
// Set the border color to black.
textView.layer.borderColor = UIColor.systemGray.cgColor
// Set the font.
textView.font = UIFont.systemFont(ofSize: 16.0)
// Set font color.
textView.textColor = UIColor.black
// Set left justified.
textView.textAlignment = NSTextAlignment.left
// Automatically detect links, dates, etc. and convert them to links.
textView.dataDetectorTypes = UIDataDetectorTypes.all
// Set shadow darkness.
textView.layer.shadowOpacity = 0.5
// Make text uneditable.
textView.isEditable = true
return textView
}()
and this is the result
