Код: Выделить всё
@main
struct MyWidget: Widget {
let kind: String = "MyWidget"
var body: some WidgetConfiguration {
if #available(iOS 18.0, *) {
AppIntentConfiguration(kind: kind, intent: MyIntent.self, provider: Provider()) { entry in
MyEntryView(entry: entry)
}
.configurationDisplayName("Display Name")
.description("Description")
.promptsForUserConfiguration()
} else {
AppIntentConfiguration(kind: kind, intent: MyIntent.self, provider: Provider()) { entry in
MyEntryView(entry: entry)
}
.configurationDisplayName("Display Name")
.description("Description")
}
}
}
Ветви имеют несовпадающие типы 'some WidgetConfiguration' (результат 'Self .promptsForUserConfiguration()') и 'some WidgetConfiguration' (результат 'Self.description')
Как вы должны использовать это, когда можете? не изменить цель развертывания на iOS 18?
Подробнее здесь: https://stackoverflow.com/questions/789 ... ployment-t