51. Adding Configuration Options to a WidgetKit Widget
The WidgetDemo app created in the preceding chapters is currently only able to display weather information for a single geographical location. Through the use of configuration intents, it is possible to make aspects of the widget user configurable. In this chapter we will enhance the widget extension so that the user can choose to view the weather for different cities. This will involve some minor changes to the weather data, the modification of the SiriKit intent definition and updates to the widget implementation.
51.1 Modifying the Weather Data
Before adding configuration support to the widget, an additional structure needs to be added to the widget data to provide a way to associate ...
Get SwiftUI Essentials – iOS 14 Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.