UITextView crash on iOS 18.4 beta

UITextView crash when setting attributed text that contains substring ffi and attributedText contains NSFontAttributeName, NSForegroundColorAttributeName

Reproducible case:

UITextView *textView = [[UITextView alloc] init];

textView.attributedText = [[NSAttributedString alloc] initWithString:@"ffi" attributes:@{ NSParagraphStyleAttributeName: [self createParagraphOfLineHeight:20], NSFontAttributeName: [UIFont systemFontOfSize:fontSize weight:UIFontWeightRegular], NSForegroundColorAttributeName: UIColor.black }];

You should probably raise this as a bug in the usual way. It won't really get progressed if it's only posted in these Developer Forums.

You need to raise each issue you find separately at https://feedbackassistant.apple.com/ You can post the FB numbers here if you want, so that others can link to them.

I tested in Swift something similar, without crash on simulator 18.4

let string = "ffi"
var style = [NSAttributedString.Key.foregroundColor: UIColor.black, NSAttributedString.Key.font: UIFont.systemFont(ofSize: 17, weight: .regular), NSAttributedString.Key.paragraphStyle: NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle]
let attributeString = NSMutableAttributedString(string: string, attributes: style)
testField.attributedText = attributeString

@neohoangokg There's not enough here to reproduce the issue.

Could you share a please share a link to a test project that reproduces the issue. That'll help us better understand what's going on. If you're not familiar with preparing a test project, take a look at Creating a test project.

The stacktrace.

We're also affected by the crash, here's two sample apps that demonstrate it:

https://github.com/plu/UITextViewCrash

FB16604342

Only happens on iOS 18.4 Beta - any other iOS version before that was fine.

In my case it happens on a letter combination that produces a ligature.

  1. Updating the font setting (this is done by our font provider) can help to fix it.
  2. Removing the ligature feature also help to fix it.

But I think there would be something wrong on iOS 18.4, please help to check it.

We are seeing this as well and seems to be happening on iOS 18.5 beta 1. Going to test on beta 3 asap.

FB17176757

Does it persist on Xcode 16.4 Beta 1 and the latest beta iOS release? The release notes are a bit scarce as they fail to mention other fixes such as the URLSession bug fixed in the Simulator.

UITextView crash on iOS 18.4 beta
 
 
Q