Chapter 16: Creating Your First Widget
With iOS 14, Apple introduced WidgetKit. Users are now able to use widgets on their home screens. By displaying small amounts of useful information on the home screen, widgets provide a key functionality to users that was long-awaited. Some examples are checking stock market prices, weather or traffic conditions, the next meeting on your calendar, and so on with just a glance at the home screen. The use cases are limitless!
In this chapter, you will learn about the basic foundations of WidgetKit, as well as the key aspects of widget design and their limitations. Then, we will build a widget from scratch. Starting with a very simple, small-sized widget, we will extend its capabilities by creating new sizes, network calls, dynamic configurations, placeholder views, and much more! We will discuss all these topics in the following sections:
- Introducing widgets and WidgetKit
- Developing your first widget
By the end of this chapter...