Disable selecting and editing of about attributed string views.
This commit is contained in:
parent
6f8c58e7a2
commit
106c47350a
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue