Please provide non-mutating equivalents of mutating functions on AttributedString

Originator:scott.matthewman
Number:rdar://FB9160121 Date Originated:2021-06-11T12:45:00+0100
Status:Open Resolved:
Product:Foundation Product Version:
Classification: Reproducible:
 
As `AttributedString` is a value type, it would be nice if the mutating functions, e.g., `replaceAttributes(_:with:)` had non-mutating versions that returned new objects. For example:

   let myNewAttributedString = existingAttributedString.replacingAttributes(myPlaceholderAttributes, with: myConcreteStylesForThisContext)

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!