2020-07-14 03:18:39 +02:00
|
|
|
//
|
|
|
|
// TitleActivityItemSource.swift
|
|
|
|
// Multiplatform iOS
|
|
|
|
//
|
|
|
|
// Created by Maurice Parker on 7/13/20.
|
|
|
|
// Copyright © 2020 Ranchero Software. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
|
|
|
|
class TitleActivityItemSource: NSObject, UIActivityItemSource {
|
|
|
|
|
|
|
|
private let title: String?
|
|
|
|
|
|
|
|
init(title: String?) {
|
|
|
|
self.title = title
|
|
|
|
}
|
|
|
|
|
|
|
|
func activityViewControllerPlaceholderItem(_ activityViewController: UIActivityViewController) -> Any {
|
|
|
|
return title as Any
|
|
|
|
}
|
|
|
|
|
|
|
|
func activityViewController(_ activityViewController: UIActivityViewController, itemForActivityType activityType: UIActivity.ActivityType?) -> Any? {
|
|
|
|
guard let activityType = activityType,
|
|
|
|
let title = title else {
|
|
|
|
return NSNull()
|
|
|
|
}
|
|
|
|
|
|
|
|
switch activityType.rawValue {
|
|
|
|
case "com.omnigroup.OmniFocus3.iOS.QuickEntry",
|
|
|
|
"com.culturedcode.ThingsiPhone.ShareExtension",
|
|
|
|
"com.tapbots.Tweetbot4.shareextension",
|
2021-05-23 12:40:12 +02:00
|
|
|
"com.tapbots.Tweetbot6.shareextension",
|
2020-07-14 03:18:39 +02:00
|
|
|
"com.buffer.buffer.Buffer":
|
|
|
|
return title
|
|
|
|
default:
|
|
|
|
return NSNull()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|