Disable selecting and editing of about attributed string views.

This commit is contained in:
Maurice Parker 2019-09-17 11:05:16 -05:00
parent 6f8c58e7a2
commit 106c47350a
1 changed files with 6 additions and 2 deletions

View File

@ -13,15 +13,19 @@ struct SettingsAttributedStringView: UIViewRepresentable {
let string: NSAttributedString let string: NSAttributedString
func makeUIView(context: Context) -> UITextView { func makeUIView(context: Context) -> UITextView {
let textView = UITextView() let textView = UITextView()
textView.attributedText = string textView.attributedText = string
textView.adjustsFontForContentSizeCategory = true
textView.translatesAutoresizingMaskIntoConstraints = false textView.translatesAutoresizingMaskIntoConstraints = false
textView.adjustsFontForContentSizeCategory = true
textView.font = .preferredFont(forTextStyle: .body) textView.font = .preferredFont(forTextStyle: .body)
textView.textColor = UIColor.label textView.textColor = UIColor.label
textView.backgroundColor = UIColor.secondarySystemGroupedBackground textView.backgroundColor = UIColor.secondarySystemGroupedBackground
textView.isEditable = false
textView.isSelectable = false
return textView return textView
} }