mastodon-app-ufficiale-ipho.../MastodonIntent/IntentHandler.swift

32 lines
727 B
Swift
Raw Permalink Normal View History

2021-07-26 14:09:23 +02:00
//
// IntentHandler.swift
// MastodonIntent
//
// Created by Cirno MainasuK on 2021-7-26.
//
import Intents
import MastodonCore
2021-07-26 14:09:23 +02:00
class IntentHandler: INExtension {
@MainActor
2021-07-26 14:09:23 +02:00
override func handler(for intent: INIntent) -> Any {
AuthenticationServiceProvider.shared.prepareForUse()
2021-07-26 14:09:23 +02:00
switch intent {
case is SendPostIntent:
return SendPostIntentHandler()
case is FollowersCountIntent:
return FollowersCountIntentHandler()
case is MultiFollowersCountIntent:
return MultiFollowersCountIntentHandler()
2023-03-27 22:41:36 +02:00
case is HashtagIntent:
return HashtagIntentHandler()
2021-07-26 14:09:23 +02:00
default:
return self
}
}
}