Skip to content

Instantly share code, notes, and snippets.

@niw
Created April 4, 2020 00:47
Show Gist options
  • Select an option

  • Save niw/03777f93a6202221ed2b4dce85f601e5 to your computer and use it in GitHub Desktop.

Select an option

Save niw/03777f93a6202221ed2b4dce85f601e5 to your computer and use it in GitHub Desktop.
macOS 10.15.4 Catalyst erases the underline for input method marked text if content attributed text has `.underlineStyle`.
let textView = UITextView(frame: view.bounds)
textView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
let text = NSMutableAttributedString(string: "test")
text.addAttributes([
.font: UIFont.systemFont(ofSize: 20.0),
.foregroundColor: UIColor.label,
.underlineStyle: 0
], range: NSRange(location: 0, length: text.length))
textView.attributedText = text
view.addSubview(textView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment