Post

Replies

Boosts

Views

Activity

SwiftUI AttributedString handle link opening.
Recently found this https://developer.apple.com/forums/thread/681875#reply-to-this-question, thread seems blocked but I got the answer so I post here: @Environment(\.openURL) var openURL var body: ....... Text(someAttributedStringWithLink) .environment(\.openURL, OpenURLAction { url in print(url) // do what you like return .handled // compiler won't launch Safari })
0
0
1.4k
Nov ’22