I added widget target in my app, and I tried to the iOS 14 and newer condition for that, but I still got this error:
'main()' is only available in application extensions for iOS 14.0 or newer
@available(iOSApplicationExtension 14.0, *)
@main
struct Widget: SwiftUI.Widget {
let kind: String = "Widget"
var body: some WidgetConfiguration {
IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in
WidgetEntryView(entry: entry)
}
.configurationDisplayName("My Widget")
.description("This is an example widget.")
}
}
That @available is the one that Xcode suggested me
Could anyone help me on that?