Make NSTextList public

Originator:oliver.drobnik
Number:rdar://28254852 Date Originated:12 September 2016
Status:Duplicate/14856331 Resolved:
Product:iOS SDK Product Version:10.0.1
Classification:Enhancement Reproducible:Always
 
Summary:
When parsing HTML into an NSAttributedString, your parser adds an NSTextList object when it encounters 

<OL><LI>Item</LI></OL>.

and sets it on the (private) textLists property on NSParagraphStyle.

This request is to promote both the NSTextList class as well as the textLists property to public API.

Without this access we are not able to use UITextView for modern rich text editing. Every modern rich text editor allows inserting and updating of ordered/unordered lists.

Since NSTextList seems to have been available since iOS 7 we believe you could make it public retroactively in a minor update to iOS 10.

Steps to Reproduce:
Paste the following into a Playground:

import UIKit

let body = "<ol><li>one</li></ol>"

let data = body.dataUsingEncoding(NSUTF8StringEncoding)
let options : [String: AnyObject] = [
    NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType,
    NSCharacterEncodingDocumentAttribute: NSUTF8StringEncoding
]

let attribStr = try! NSAttributedString(data: data!, options: options, documentAttributes: nil)
print(attribStr)

Expected Results:
The print shows that there is an NSTextList object present. But there is no public API to work with it.

Actual Results:
I would expect to be able to access the textLists property of the paragraph style.

Version:
iOS 10.0.1

Notes:


Configuration:
iPhone 6S

Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!