Hi,
Is there a way I can pass StaticConfiguration or IntentConfiguration depending upon some conditions?
right now it gives build error:
Function declares an opaque return type, but the return statements in its body do not have matching underlying types
Is there a way I can pass StaticConfiguration or IntentConfiguration depending upon some conditions?
right now it gives build error:
Function declares an opaque return type, but the return statements in its body do not have matching underlying types
I know this has to do with opaque return type, but is there a way to achieve this?var body: some WidgetConfiguration {
if condition {
return IntentConfiguration(kind: kind, intent: MyIntent.self, provider: Provider()) { entry in
MyWidgetEntryView(entry: entry)
}
.configurationDisplayName("")
.description("")
.supportedFamilies([.systemLarge])
} else {
return StaticConfiguration(kind: kind, provider: MyProvider()) { entry in
MyWidgetEntryView(entry: entry)
}.configurationDisplayName("")
.description("")
.supportedFamilies([.systemLarge])
}
}