iOS 18 crash on UITextView

Below style case was crash after 17.6.1

import UIKit
import PlaygroundSupport

class MyViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = .white

let titleText = UITextView(frame: CGRect(origin: .zero, size: CGSize(width: 82, height: 100)))
titleText.textContainer.maximumNumberOfLines = 2
titleText.textContainer.lineFragmentPadding = 0
titleText.textContainer.lineBreakMode = .byTruncatingTail
titleText.textContainerInset = UIEdgeInsets.zero

let attributedText = NSMutableAttributedString(string: text, attributes: [.font: UIFont.systemFont(ofSize: 14), .foregroundColor: UIColor.red])
titleText.attributedText = attributedText
view.addSubview(titleText)
self.view = view
}
}
// Present the view controller in the Live View window
PlaygroundPage.current.liveView = MyViewController()

let text =

355ml\t

I can not write problem text in here

It seems that you are reporting that UITextView crashes when rendering text containing special characters. That will definitely be a bug on the system side, and so I’d suggest that you file a feedback report – If you do so, please share your report ID here for folks to track.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

iOS 18 crash on UITextView
 
 
Q