From 12731c2e397720f54e55d319cb4dca17af90bfaa Mon Sep 17 00:00:00 2001 From: Martin Hartl Date: Sun, 5 Jan 2020 07:36:30 +0100 Subject: [PATCH] Share string with subject and URL instead of plain URL for Omnifocus and Things --- iOS/ArticleActivityItemSource.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/iOS/ArticleActivityItemSource.swift b/iOS/ArticleActivityItemSource.swift index ba168651e..19177615f 100644 --- a/iOS/ArticleActivityItemSource.swift +++ b/iOS/ArticleActivityItemSource.swift @@ -23,7 +23,18 @@ class ArticleActivityItemSource: NSObject, UIActivityItemSource { } func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivity.ActivityType?) -> Any? { - return url + guard let activityType = activityType, + let subject = subject else { + return url + } + + switch activityType.rawValue { + case "com.omnigroup.OmniFocus3.iOS.QuickEntry", + "com.culturedcode.ThingsiPhone.ShareExtension": + return "\(subject)\n\(url)" + default: + return url + } } func activityViewController(_ activityViewController: UIActivityViewController, subjectForActivityType activityType: UIActivity.ActivityType?) -> String {