         controller.dismiss(animated: true, completion: nil)
 
         let success = (result == MessageComposeResult.sent)
-        let textActivity = ShareDestination.text(parameters: TextShareParameters()).activityType
-        self.sharingCompleted?((success: success, sharingService: textActivity))
-    }
-
+        self.sharingCompleted?((success: success, sharingService: ShareDestination.text.activityType))
+    }
+
+}
+
+
+private extension UIViewController {
+
+    func shareIfPossible(destination: ShareDestination, canShareAction: () -> Void) {
+        if destination.canShare {
+            canShareAction()
+        } else {
+            self.sharingCompleted?((success: false, sharingService: destination.activityType))
+        }
+    }
+    
 }
 
 


public struct SocialShareParameters {

    let message: String?
    let images: [UIImage]?
    let urls: [URL]?

    init(message: String? = nil, images: [UIImage]? = nil, urls: [URL]? = nil) {
        self.message = message
        self.images = images
        self.urls = urls

        self.filename = filename
        self.data = data
    }

}


// MARK: Boxing so we can store the sharingCompleted closure on UIViewController

private class SharingCompletedEventBox {

    var event: SharingCompletedEvent?

    init(event: SharingCompletedEvent?) {
        self.event = event
    }

}
