@@ -65,7 +65,7 @@ class EditorDemoController: UIViewController {
6565
6666 private func setupHTMLTextView( _ textView: UITextView ) {
6767 let accessibilityLabel = NSLocalizedString ( " HTML Content " , comment: " Post HTML content " )
68- self . configureDefaultProperties ( for : textView, accessibilityLabel: accessibilityLabel)
68+ self . configureDefaultProperties ( htmlTextView : textView, accessibilityLabel: accessibilityLabel)
6969
7070 textView. isHidden = true
7171 textView. delegate = self
@@ -325,7 +325,22 @@ class EditorDemoController: UIViewController {
325325 }
326326
327327
328- private func configureDefaultProperties( for textView: UITextView , accessibilityLabel: String ) {
328+ private func configureDefaultProperties( for textView: TextView , accessibilityLabel: String ) {
329+ textView. accessibilityLabel = accessibilityLabel
330+ textView. font = Constants . defaultContentFont
331+ textView. keyboardDismissMode = . interactive
332+ if #available( iOS 13 . 0 , * ) {
333+ textView. textColor = UIColor . label
334+ textView. defaultTextColor = UIColor . label
335+ } else {
336+ // Fallback on earlier versions
337+ textView. textColor = UIColor ( red: 0x1A / 255.0 , green: 0x1A / 255.0 , blue: 0x1A / 255.0 , alpha: 1 )
338+ textView. defaultTextColor = UIColor ( red: 0x1A / 255.0 , green: 0x1A / 255.0 , blue: 0x1A / 255.0 , alpha: 1 )
339+ }
340+ textView. linkTextAttributes = [ . foregroundColor: UIColor ( red: 0x01 / 255.0 , green: 0x60 / 255.0 , blue: 0x87 / 255.0 , alpha: 1 ) , NSAttributedString . Key. underlineStyle: NSNumber ( value: NSUnderlineStyle . single. rawValue) ]
341+ }
342+
343+ private func configureDefaultProperties( htmlTextView textView: UITextView , accessibilityLabel: String ) {
329344 textView. accessibilityLabel = accessibilityLabel
330345 textView. font = Constants . defaultContentFont
331346 textView. keyboardDismissMode = . interactive
0 commit comments