 class ShareViewController: SLComposeServiceViewController {
 
     var itemPreviews: [ExtensionItemPreview] = []
+    var itemsProcessed = false
     fileprivate lazy var background: UIView = self.createBackground()
 
-    // moved into a separate function to save compile time
     fileprivate func createBackground() -> UIView {
         let view = UIView()
         view.alpha = 0


    func processAttachments() {
        guard let extensionItem = extensionContext?.inputItems.safeValue(0) as? NSExtensionItem else {
            return
        }


        PostEditingService().create(content: content, buyButtonURL: nil)
            .thenFinally { post in
//                Tracker.shared.shareSuccessful()
                self.dismissPostingForm()
            }
            .catch { error in
//                Tracker.shared.shareFailed()
                self.showFailedToPost()
            }
            .always { _ in
                self.donePosting()
            }
    }

