(iOS 17 & 18) Using QLPreviewController in specific app, added text colour reverts to black on text edit

In the company that I work we have a huge app and we have implemented an image annotation feature using the QLPreviewController but there is a bug where even with an OOTB implementation of the QLPreviewController, when I add a text, change the colour of that text and then double click on the text to edit it, it reverts back to black.

I tried the same implementation in a sample app but I couldn't reproduce the bug hence it is not a bug with the library but something with the app interacting with the library. I was wondering if anyone can provide any suggestion with what the reason may be, as sadly I cannot provide any code examples as that would break company code.

From my research what I found strange is that when I double click the coloured text and it goes to black, then undo it its as if that was not a recorded event as the undo goes back to the step before the text was coloured meaning it replaces the colour changing event rather than recording it as a new event that can be undone.

If any has any suggestion please help me as I am quite stuck. 🙏

After some investigation I found that changing UITextView.appearance().textColor will also change the text annotation in the QLPreviewController which I think should be reported as a bug. Sadly we need the textColor implementation so that by default all UITextViews use it so now I am looking into ways to exclude the QLPreviewController from it.

(iOS 17 & 18) Using QLPreviewController in specific app, added text colour reverts to black on text edit
 
 
Q