widgetexamples

repository·main·Indexed 22 days ago

https://github.com/pawello2222/widgetexamples

A demo project showcasing iOS widget implementations using SwiftUI and WidgetKit for iOS 17. It includes examples of basic widgets (App Group, Core Data, SwiftData, Live Activities), intent-based widgets using the AppIntents framework, and unofficial widgets using private APIs. Featured implementations include analog and digital clocks, audio playback, countdowns, deep linking, network data loading, and shared views between apps and widgets.

Tokens
1.2K
Snippets
0
Records
18
Agent score
78%

What's inside widgetexamples

  1. Overview of Widget Examples

    main

    Widget Examples is a demo project designed to showcase various types of iOS widgets built using SwiftUI and WidgetKit. It serves as a reference for implementing different widget functionalities, ranging from basic data display to interactive intent-based widgets.

    The project is categorized into three main types of widgets:

    1. Basic widgets: Standard widgets using public APIs (e.g., App Group, Core Data, SwiftData, Live Activities).
    2. Intent widgets: Widgets that utilize Apple's AppIntents framework for user interaction.
    3. Unofficial widgets: Widgets that utilize private APIs. Warning: These may not pass Apple's review process and should be used at your own risk.

    This project requires iOS 17 for the current version.

  2. Use Core Data to share data between an App and a Widget

    main
    The CoreDataWidget example demonstrates how to implement data sharing between a main iOS application and its corresponding Home Screen Widget using the Core Data framework. This pattern is essential when the widget needs to display or interact with the same persistent data managed by the app.
  3. Use the Deep Link Widget to pass information to the parent App

    main
    The DeepLinkWidget allows you to pass specific information or context from a widget directly to the parent application when the user taps on the widget to open it. This enables seamless transitions where the app can navigate to a specific state or screen based on the data provided by the widget.