ShareViewController.swift 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. //
  2. // ShareViewController.swift
  3. // DeltaChatShare
  4. //
  5. // Created by Macci on 02.01.20.
  6. // Copyright © 2020 Jonas Reinsch. All rights reserved.
  7. //
  8. import UIKit
  9. import Social
  10. class ShareViewController: SLComposeServiceViewController {
  11. override func isContentValid() -> Bool {
  12. // Do validation of contentText and/or NSExtensionContext attachments here
  13. return true
  14. }
  15. override func didSelectPost() {
  16. // This is called after the user selects Post. Do the upload of contentText and/or NSExtensionContext attachments.
  17. // 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.
  18. self.extensionContext!.completeRequest(returningItems: [], completionHandler: nil)
  19. }
  20. override func configurationItems() -> [Any]! {
  21. // To add configuration options via table cells at the bottom of the sheet, return an array of SLComposeSheetConfigurationItem here.
  22. return []
  23. }
  24. }