IntentHandler.swift 573 B

123456789101112131415161718192021222324
  1. //
  2. // IntentHandler.swift
  3. // MastodonIntent
  4. //
  5. // Created by Cirno MainasuK on 2021-7-26.
  6. //
  7. import Intents
  8. class IntentHandler: INExtension {
  9. override func handler(for intent: INIntent) -> Any {
  10. // This is the default implementation. If you want different objects to handle different intents,
  11. // you can override this and return the handler you want for that particular intent.
  12. switch intent {
  13. case is SendPostIntent:
  14. return SendPostIntentHandler()
  15. default:
  16. return self
  17. }
  18. }
  19. }