iOS 15 WidgetKit: Building Widgets with SwiftUI
Specifically for iOS 15, Xcode 13 and SwiftUI 3.
Apple first introduced Widgets in iOS 14 at WWDC 2020, and they've been one of the most popular additions to iOS in recent years. In this book, we'll cover everything there is to know about WidgetKit; Apple's framework to build widgets for iOS and iPadOS. 🎉
What's in the Book?
This book is going to take you through the full spectrum of functionality that widgets offer; you’ll learn everything there is to know about them. To keep the content WidgetKit specific; we won’t be delving too deeply into the standard SwiftUI side of things. We’ll be keeping the user interfaces really simple and purely focussing on the quirks of using WidgetKit.
In Chapter 2, we’ll start by learning the basics and fundamentals of WidgetKit and explore the terminology used by Apple. We’ll configure a simple iOS app project that contains multiple, static widgets along with the main iOS app. ⚒️
Following on, in Chapter 3 we’ll use these fundamental principles to build a simple Battery Status widget similar to the default app found in iOS 15. You’ll learn how to populate the widget with real battery level data and display it in different UIs depending on the widget size. 🔋
In Chapter 4, we’ll take things further by building a ToDo List app and widget where the data displayed on the widget is shared between the two. You’ll also learn how to manually refresh widgets from the parent app when data is changed. ✅
Lastly in Chapter 5, we’ll build a Weather Forecast widget with real, localised weather data fed directly from a weather API. We’ll also explore how we can give the user the ability to customise and configure their widget by allowing them to choose a location for the weather forecast directly from the widget. ⛅
Table of Contents
Download the full table of contents. 📘
Download a Free Sample!
Here's a sample introduction chapter from the eBook. No email address required. 🙌
Any Pre-Requisites Needed?
The book assumes a basic understanding of SwiftUI. Whilst the content of the book focuses on WidgetKit, and not on building complex UIs; an understanding of the basic SwiftUI concepts is needed. 👊
Any other Questions?
If you have any questions or suggestions, please don't hesitate to contact me on Twitter and I'll do my best to help. 😊
You'll get the download version of iOS 15 WidgetKit: Building Widgets with SwiftUI as PDF.