Gemini/GeminiIntents/IntentHandler.swift

44 lines
1.1 KiB
Swift

//
// IntentHandler.swift
// GeminiIntents
//
// Created by Shadowfacts on 9/30/21.
//
import Intents
class IntentHandler: INExtension {
override func handler(for intent: INIntent) -> Any? {
switch intent {
// we also need to support extension-based handling because in-app handling isn't support <iOS 14
case is OpenURLIntent:
return OpenURLIntentHandler()
case is OpenHomepageIntent:
return OpenHomepageIntentHandler()
case is MakeRequestIntent:
return MakeRequestIntentHandler()
case is GetBodyIntent:
return GetBodyIntentHandler()
case is GetStatusIntent:
return GetStatusIntentHandler()
case is GetMetaIntent:
return GetMetaIntentHandler()
case is GemtextToHTMLIntent:
return GemtextToHTMLIntentHandler()
case is GemtextToMarkdownIntent:
return GemtextToMarkdownIntentHandler()
default:
return nil
}
}
}