49.1 Supporting Multiple Size Families
Begin by launching Xcode and loading the WidgetDemo project from the previous chapter. As outlined above, this phase of the project will add support for the medium widget size (though these steps apply equally to adding support for the large widget size).
In the absence of specific size configuration widgets are, by default, configured to support all three size families. To restrict a widget to specific sizes, the supportedFamilies() modifier must be applied to the widget configuration.
To restrict the widget to only small and medium sizes for the WidgetDemo project, edit the WeatherWidget.swift file and modify the WeatherWidget declaration to add the modifier. Also take this opportunity to modify the widget display name and description:
@main
struct WeatherWidget: Widget {
private let kind: String = "WeatherWidget"
public var body: some WidgetConfiguration ...