Merge pull request #1533 from hartlco/1517-sharing-article-to-omnifocus-leaves-new-item-title-blank

Share string with subject and URL instead of plain URL for Omnifocus and Things
This commit is contained in:
Brent Simmons 2020-01-05 12:54:03 -08:00 committed by GitHub
commit 4184202806
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -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 {