 
 public struct SocialShareParameters {
 
+    let network: ShareDestination.SocialNetwork
     let message: String?
     let images: [UIImage]?
     let urls: [URL]?
 
-    init(message: String? = nil, images: [UIImage]? = nil, urls: [URL]? = nil) {
+    init(network: ShareDestination.SocialNetwork, message: String? = nil, images: [UIImage]? = nil, urls: [URL]? = nil) {
+        self.network = network
         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
    }
    
}


public enum ShareDestination {

    case text
    case email
    case twitter
    case facebook
    case sinaWeibo
    case tencentWeibo
    case pasteboard
    case photos
    case activityController

    public var canShare: Bool {
        switch self {

        case .text:
            return MFMessageComposeViewController.canSendText()

        case .email:
            return MFMailComposeViewController.canSendMail()

        case .twitter:
            return SLComposeViewController.isAvailable(forServiceType: SLServiceTypeTwitter)

        case .facebook:
            return SLComposeViewController.isAvailable(forServiceType: SLServiceTypeFacebook)

        case .sinaWeibo:
            return SLComposeViewController.isAvailable(forServiceType: SLServiceTypeSinaWeibo)

        case .tencentWeibo:
            return SLComposeViewController.isAvailable(forServiceType: SLServiceTypeTencentWeibo)

        case .pasteboard:
            return true

        case .photos:
            return PHPhotoLibrary.authorizationStatus() == .authorized

        case .activityController:
            return true

        }
