IceCubes/IceCubesAppWidgetsExtension/HashtagPostsWidget/HashtagPostsWidgetConfiguration.swift

23 lines
703 B
Swift
Raw Normal View History

2024-05-05 19:31:28 +02:00
import AppIntents
2024-05-06 08:38:37 +02:00
import WidgetKit
2024-05-05 19:31:28 +02:00
struct HashtagPostsWidgetConfiguration: WidgetConfigurationIntent {
2024-06-26 11:05:35 +02:00
static let title: LocalizedStringResource = "Hashtag Widget Configuration"
2024-05-05 19:31:28 +02:00
static let description = IntentDescription("Choose the account and hashtag for this widget")
2024-05-06 08:38:37 +02:00
2024-05-05 19:31:28 +02:00
@Parameter(title: "Account")
var account: AppAccountEntity?
2024-05-06 08:38:37 +02:00
2024-05-05 19:31:28 +02:00
@Parameter(title: "Hashtag")
var hashgtag: String?
2024-05-05 19:31:28 +02:00
}
extension HashtagPostsWidgetConfiguration {
static var previewAccount: HashtagPostsWidgetConfiguration {
let intent = HashtagPostsWidgetConfiguration()
intent.account = .init(account: .init(server: "Test", accountName: "Test account"))
intent.hashgtag = "Mastodon"
return intent
}
}