Links in AttributedString Markdown fail to load

I am using a AttributedString for markdown. When I add the attributed text, it previews correctly. However, when tapping on the URL it fails to load. Bug or not? I'll post a feedback if so.


class ViewController: UIViewController {
    let string = """
    **Thank you** and please _visit_ our [Website](https://www.website.com).

        ```for item in items```
            ```let item one be something```
        ```end```
    
    ~~Strikethrough~~
    """
    @IBOutlet weak var label: UILabel!
    override func viewDidLoad() {
        super.viewDidLoad()
        if let attributedText = try? NSMutableAttributedString(markdown: string, options: AttributedString.MarkdownParsingOptions(interpretedSyntax: .inlineOnlyPreservingWhitespace)) {
                 let range = NSRange(location: 0, length: attributedText.mutableString.length)
            attributedText.addAttribute(NSAttributedString.Key.font, value: UIFont.preferredFont(forTextStyle: .title3), range: range)
            label.attributedText = attributedText
        }
    }
}

I cannot find any code to respond to taps on the UILabel, better search with "links in uilabel". Or else, using UITextView would be easier.

@OOper It works in uitextview (although not underlined) and SwiftUI’s text. I think it should likely work in a label as well without any developer intervention. I filed a feedback. What is the point in putting an link if it doesn’t work?

I filed a feedback.

Thanks.

What’s its number?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Links in AttributedString Markdown fail to load
 
 
Q