A demo project showcasing different types of Widgets created with SwiftUI and WidgetKit.
This project is being refactored for iOS 17.
All changes remain on the branch ios17-refactor
and will be merged once iOS 17 is released. Pre-iOS 17 project will always be available under v0.6.2.
A demo showcasing how to use an App Group to share data between an App and its Widget.
A Widget that displays the current time (in various formats) and refreshes every minute.
A demo showcasing how to use Core Data in a Widget.
A Widget that displays the remaining time in seconds and changes color when the end date is approaching.
A demo showcasing how to use Deep Links to pass events / information from a Widget to the parent App.
A Widget that has dynamically configurable data.
A demo showcasing how to adjust a Widget View depending on Environment variables.
A Widget that has a configurable background color.
A Widget that can be displayed on both the lock screen and the home screen.
A demo showcasing how to load data from a network request and populate the Widget Timeline.
A demo showcasing how to display a Widget View directly in the parent App.
A Widget that displays the current time (including seconds) as a timer.
A Widget that displays an Image downloaded from an external URL.
A Widget that displays an Image downloaded from an external URL and caches it.
Some examples depend on the App Group capability (e.g., AppGroup Widget) or integrate with the main App (e.g., Preview Widget), so it's recommended to download the whole project to keep the configuration intact.
Widget Examples project is available under the MIT license. See the LICENSE file for more info.