79719552

Date: 2025-07-30 06:57:26
Score: 0.5
Natty:
Report link

Not a solution, but the best I could come up with in SwiftUI is to split the text into paragraphs and allow copying each one individually:

let text = """
    Multiple URLs here, such as https://stackoverflow.com
    or https://www.google.com
    """

LazyVStack(alignment: .leading, spacing: 0) {
    let texts = text.split(separator: "\n", omittingEmptySubsequences: false)
    ForEach(Array(texts.enumerated()), id: \.offset) { _, text in
        Text(LocalizedStringKey(String(text)))
    }
}
.textSelection(.enabled)

Sadly the .textSelection(.enabled) only allows selecting everything at once on iOS.

Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: fer0n