diff options
Diffstat (limited to 'foray/Coordinators')
-rw-r--r-- | foray/Coordinators/ForayCoordinator.swift | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/foray/Coordinators/ForayCoordinator.swift b/foray/Coordinators/ForayCoordinator.swift index 972bfb8..70febce 100644 --- a/foray/Coordinators/ForayCoordinator.swift +++ b/foray/Coordinators/ForayCoordinator.swift @@ -39,7 +39,7 @@ class ForayCoordinator: Coordinator { } func share(item: PenguinItemViewModel) { - let itemSource = ForayLinkPresentationSource(title: "\(item.name) (#\(item.id))", shareURL: URL(string: "https://nick.tay.blue/")!) + let itemSource = ForayLinkPresentationSource(title: "\(item.name) (#\(item.id))", shareURL: URL(string: "https://nick.tay.blue/")!, image: item.icon) let activity = UIActivityViewController(activityItems: [itemSource], applicationActivities: nil) navigationController.present(activity, animated: true) } @@ -61,9 +61,9 @@ class ForayLinkPresentationSource: NSObject, UIActivityItemSource { return metadata.originalURL } - init(title: String, shareURL: URL) { + init(title: String, shareURL: URL, image: UIImage? = nil) { metadata = LPLinkMetadata() - metadata.iconProvider = NSItemProvider(contentsOf: Bundle.main.url(forResource: "spy", withExtension: "png")) + metadata.iconProvider = NSItemProvider(object: image ?? UIImage.fromAsset(.spy)) metadata.originalURL = shareURL metadata.url = shareURL metadata.title = title |