UlTextView erroneously overrides string attributes when applying spellchecker annotation attributes (regression)

UITextView erroneously overrides string attributes when applying spellchecker annotation attributes.

It doesn't need any particular setting. Default UITextView instance with attributed text

let textView = UITextView(usingTextLayoutManager: true)
textView.spellCheckingType = .yes

Once spellcheck attributes get applied, other attributes like foreground color get applied to the misspelled words. This behavior happens only on Mac Catalyst, and started to appear on macOS 14 or newer.

Please check the Xcode project that demonstrates the issue https://github.com/user-attachments/files/16689336/TextEditor-FB14165227.zip

  1. Open TextEditor project
  2. Select "My Mac (Mac Catalyst)" build destination
  3. Run the project. A window with a text area should appear
  4. Select the whole text (either using mouse or keyboard command+a)
  5. Observe how foregroundColor changes to text (this is the issue)
  6. That eventually led to crash 💥

This bug is reported to Apple FB14165227

Answered by DTS Engineer in 801050022

@krzyzanowskim Thank you for submitting the Feedback Report. I wasn’t able to reproduce the issue with the latest beta version. Could you please try reproducing the issue on macOS 15 beta 7 or iOS 18 beta 7? Thanks!

Accepted Answer

@krzyzanowskim Thank you for submitting the Feedback Report. I wasn’t able to reproduce the issue with the latest beta version. Could you please try reproducing the issue on macOS 15 beta 7 or iOS 18 beta 7? Thanks!

UlTextView erroneously overrides string attributes when applying spellchecker annotation attributes (regression)
 
 
Q