From 779144d26aa5150b5c62300ddbe954abe114f733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= Date: Mon, 6 Oct 2025 14:09:10 +0200 Subject: [PATCH] Fix: iOS app was unable to send URLs --- ShareExtension/Attachments.swift | 72 ++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/ShareExtension/Attachments.swift b/ShareExtension/Attachments.swift index bb63eb0..d6a3258 100644 --- a/ShareExtension/Attachments.swift +++ b/ShareExtension/Attachments.swift @@ -24,31 +24,8 @@ func loadAttachments(with extensionContext: NSExtensionContext?, loadedItems: @e let item = extensionContext.inputItems[0] as! NSExtensionItem if let attachments = item.attachments { - if let text = item.attributedContentText?.string { - - log("Found text content: \(text)") - - result.textToSend = text - - #if os(macOS) - result.previewImage = NSImage(named: NSImage.multipleDocumentsName) - #else - result.previewImage = Image(systemName: "text.document") - #endif - - let maxLength = 50 - let cleanedText = text.replacingOccurrences(of: "\n", with: " ").replacingOccurrences(of: "\r", with: "") - - if cleanedText.count > maxLength { - let index = cleanedText.index(cleanedText.startIndex, offsetBy: maxLength) - result.shortDescription = String(cleanedText[.. maxLength { + let index = cleanedText.index(cleanedText.startIndex, offsetBy: maxLength) + result.shortDescription = String(cleanedText[..