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
}
}
}