Replacing the NSLayoutManager for UITextView causes no text to be rendered in iOS 15

I have a simple project where I replace the NSLayoutManager for a UITextView initialized in a storyboard using UITextView.textContainer.replaceLayoutManager(…).

On iOS 14.5, the layout manager is correctly replaced and the overridden drawUnderline function is called to correctly render the text using the subclassed NSLayoutManager.

On iOS 15.2, none of the overridden functions in the NSLayoutManager subclass are being called, and no text is rendered in the UITextView.

Custom NSLayoutManager:

ViewController:

Result (iOS 14.5 on the left, iOS 15.2 on the right):

I think this is a regression in iOS 15 and not from my code, however I could be missing something.

Replacing the NSLayoutManager for UITextView causes no text to be rendered in iOS 15
 
 
Q