         return []
     }
 
-    private func postFeed(message message: String?, URL: NSURL) {
+    private func postFeed(message message: String?, URL: NSURL, completion: (finish: Bool) -> Void) {
 
         var kind: FeedKind = .Text
 

        // Inform the host that we're done, so it un-blocks its UI. Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context.

        guard !(contentText ?? "").isEmpty else {
            return
        }

        guard let item = extensionContext?.inputItems.first as? NSExtensionItem else {
            return
        }

        guard let itemProvider = item.attachments?.first as? NSItemProvider else {
            return
        }

        let URLTypeIdentifier = kUTTypeURL as String

        guard itemProvider.hasItemConformingToTypeIdentifier(URLTypeIdentifier) else {
            return
        }

        itemProvider.loadItemForTypeIdentifier(URLTypeIdentifier, options: nil) { [weak self] secureCoding, error in

            guard error == nil else {
                return
            }

            guard let URL = secureCoding as? NSURL else {
                return
            }

            self?.postFeed(message: self?.contentText, URL: URL)
        }
    }


                return token
            }

            createFeedWithKind(kind, message: message, attachments: attachments, coordinate: nil, skill: nil, allowComment: true, failureHandler: { reason, errorMessage in
                defaultFailureHandler(reason: reason, errorMessage: errorMessage)

                dispatch_async(dispatch_get_main_queue()) {
                    completion(finish: false)
                }
                
            }, completion: { feed in
                print("share created feed: \(feed)")

                dispatch_async(dispatch_get_main_queue()) {
                    completion(finish: true)
                }
            })
        }
    }
}

