SwiftUI AttributedString Doesn't Support Highlight States for Links

Originator:bryn.bodayle
Number:rdar://FB9717823 Date Originated:10/21/21
Status:Open Resolved:
Product:SwiftUI Framework Product Version:iOS 15
Classification:Incorrect/Unexpected Behavior Reproducible:Always
 
Thrilled that iOS 15 added SwiftUI support for inline links through markdown and the AttributedString API, however there is no way to add or customize a link highlight state for the inline links. Take this code for example:

struct TextExample: View {
    var body: some View {
      let text = try! AttributedString(markdown: "This is my inline [link](https://www.apple.com). How do I set the highlight state?")
      return Text(text)
    }
}

If the user taps the link, there is no highlight state applied. Additionally, engineers should be able to customize the style of this highlight state to provide an animation, overlay, and text style changes.

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!