I am using xcode Version 12.1
Widgets are added by size to the app being serviced, but only the medium size is shown.
Below is the code.
var entry: Provider.Entry
@Environment(\.widgetFamily) var family
var body: some View {
VStack {
Text(entry.date, style: .time)
switch family {
case .systemSmall:
Text("Small")
case .systemMedium:
Text("Medium")
case .systemLarge:
Text("Large")
default:
Text("Some other WidgetFamily in the future.")
}
}
}
and It works well when it comes to a new project, but why does this work in an existing app?
Widgets are added by size to the app being serviced, but only the medium size is shown.
Below is the code.
var entry: Provider.Entry
@Environment(\.widgetFamily) var family
var body: some View {
VStack {
Text(entry.date, style: .time)
switch family {
case .systemSmall:
Text("Small")
case .systemMedium:
Text("Medium")
case .systemLarge:
Text("Large")
default:
Text("Some other WidgetFamily in the future.")
}
}
}
and It works well when it comes to a new project, but why does this work in an existing app?