what is changing with widget kit?

Asked on 08/02/2024

1 search

Changes in WidgetKit

Several updates and enhancements have been introduced to WidgetKit, as discussed in various sessions at WWDC 2024:

  1. Interactive Widgets:

    • Widgets can now have multiple interactive areas that perform actions and update state directly within the widget. This is supported across iOS, macOS, and now watchOS.
    • Buttons and toggles can be added to widgets to perform actions without leaving the widget.
    • Platforms State of the Union (50:50)
  2. Accessory Widget Group Layout:

    • A new layout called "Accessory Widget Group" allows for more information and interactivity. It supports up to three separate views and can deep link to different parts of your app.
    • This layout is particularly useful for creating more glanceable and actionable widgets.
    • What’s new in watchOS 11 (07:51)
  3. Relevant Widgets:

    • Widgets can now specify one or more relevant contexts (e.g., time of day, location, routine) to appear in the smart stack at the most useful times.
    • This helps the system intelligently surface widgets when they are most needed.
    • What’s new in watchOS 11 (05:01)
  4. Controls in iOS 18:

    • A new type of widget called "controls" has been introduced. These can extend app functionality into system spaces like Control Center, the lock screen, and the action button.
    • Controls focus on actions and succinct information, making them ideal for quick access tasks.
    • Extend your app’s controls across the system (00:07)
  5. Enhanced Configuration:

  6. New View Template API:

    • A new view template API called "Accessory Widget Group" has been introduced to create views in an accessory rectangular widget with up to three different pieces of content.
    • This template enhances glanceability and interactivity.
    • What’s new in watchOS 11 (07:51)
  7. Text and Date Formats:

    • New text formats for displaying live times and dates have been added, which work great in widgets and live activities.
    • These formats include date references, date offsets, and timers, and are deeply customizable.
    • What’s new in SwiftUI (11:37)

These updates make widgets more interactive, configurable, and contextually relevant, enhancing the overall user experience across Apple's ecosystem.