NSTextList not rendering on MacOS

In the WWDC22 talk "What's new in TextKit and text views" (https://developer.apple.com/videos/play/wwdc2022/10090?time=408), it was announced (at minute 6:45) that TextKit 2 & NSTextList is supposed to be working on both UIKit and AppKit. While NSTextLists are correctly rendering on iOS, they are not working on macOS. The paragraphs aren't inset and the numbers/bullets do not render in front of the list items. Any help?

let textView = NSTextView(frame: self.view.bounds)
textView.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(textView)
let safeArea = view.safeAreaLayoutGuide
NSLayoutConstraint.activate([
    textView.topAnchor.constraint(equalTo: safeArea.topAnchor),
    textView.bottomAnchor.constraint(equalTo: safeArea.bottomAnchor),
    textView.leadingAnchor.constraint(equalTo: safeArea.leadingAnchor),
    textView.trailingAnchor.constraint(equalTo: safeArea.trailingAnchor)
])

let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.textLists = [NSTextList(markerFormat: NSTextList.MarkerFormat("{decimal}."), options: 0)]

let attributedText = NSMutableAttributedString("Item 1\nItem 2\nItem 3\nItem 4f")
attributedText.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: attributedText.length))
textView.textStorage?.setAttributedString(attributedText)

That seems to be a regression unfortunately. I’d suggest that you file a feedback report to see what the TextKit folks have to say – If you do so, please share your report ID here.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

I'm not sure if it's regression - the NSTextList never worked in the first place (or, they only work when you manually add the bullets into the text content itself - which user could select and delete). On iOS, the bullets are non-selectable and added automatically, just by setting the ParagraphStyle. I submitted a feedback report: FB15162186

Thanks for filing the feedback. If I remember correctly, NSTextList worked in the Enriching your text in text views sample we wrote for the WWDC22 session. It has been a while and my memory becomes vague though...

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Downloaded that example project and ran it on my macOS 14.7 machine: the bullets/numbers do not render - do they on your machine?

No, they don't render on my macOS Sonoma (14.6.1) Mac. I don't have a macOS Ventura (13) machine to try though.

Just to give you an update: The bug report you filed was treated as a new bug, and is under the investigation of the TextKit team.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Thanks for the repsonse. I'm glad this issue is now being investigated, and I'm a bit surprised this hasn't been reported by another user before.

NSTextList not rendering on MacOS
 
 
Q