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()