ex.:
Project prefix:
ABCIntents file:
MyIntents.intentdefinitionCustom Intent:
DynamicMySelectionSolution:
put this line to bridge header:
Code Block | #import "ABCDynamicMySelectionIntent.h" |
Here is example of your provider:
Code Block | struct Provider: IntentTimelineProvider { |
| typealias Intent = ABCDynamicMySelectionIntent |
|
| func getSnapshot(for configuration: ABCDynamicMySelectionIntent, in context: Context, completion: @escaping (SimpleEntry) -> Void) {...} |
|
| func getTimeline(for configuration: ABCDynamicMySelectionIntent, in context: Context, completion: @escaping (Timeline<SimpleEntry>) -> Void) {...} |
| } |
|
| struct MyWidget: Widget { |
| let kind: String = "MyWidget" |
|
| var body: some WidgetConfiguration { |
| IntentConfiguration(kind: kind, intent: ABCDynamicMySelectionIntent.self, provider: Provider()) { entry in |
| ... |
| } |
| } |